The NavigationMenu arrow-key tests queried `document` globally for their triggers/links. Portalled popup content renders into `document.body` outside the mounted root, so any residue — from this file or another suite sharing the single happy-dom `document` — inflated the counts. That made the tests order-dependent: green locally and in a stock-bun container, but red on CI (where the test-file execution order differs), where `btns()` returned 9 buttons (3 tests × 3) instead of 3 and focus assertions landed on the wrong element. One test then wedged the whole run for ~168s because `settleFocus()` only awaited a microtask, starving bun's 5s timeout timer. Fixes: - `makeRoots`: clear `document.body` on the first mount of each test and in cleanup, so every test starts from a pristine document regardless of what another suite leaked. - arrow-navigation: scope trigger queries to the mounted root; make `settleFocus` yield a real macrotask so a stuck test fails fast at the 5s deadline instead of hanging. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Battery Bot committed on 7/6/2026, 3:01:32 AMparent722b24e
2 files changedLine totals unavailable