The results section is removed and re-created during processing, causing stale element references in automated tests.
Click "Process Data" to start. The results section is immediately removed from the DOM, then a completely new results section is rendered after 500ms. Any reference to the old element becomes stale.
This timeline shows the sequence of DOM operations during processing.
When a test grabs a reference to the results element and then the processing removes and re-creates it, the old reference points to a detached DOM node. Any assertion on that reference will fail or return stale data.
document.querySelector('#results-section') references become stale