Repository navigation
fix: await the pairing queue focus assertion - #695
Merged
Merged
Conversation
enaboapps
force-pushed
the
fix/pairing-focus-flake-694
branch
from
September 8, 2026 14:37
f09fe39 to
3cb30ee
Compare
"handles simultaneous pairing requests without discarding the queue" failed intermittently on CI while passing locally. Its final focus assertion was not wrapped in waitFor, unlike the earlier one in the same test. PairingDialog moves focus from a passive effect keyed on `requests` (src/App.tsx). The preceding waitFor only observes that the approved device's heading is gone; it does not guarantee that effect has run for the re-rendered dialog, so under CI load the assertion can catch the intermediate state. Scanned the rest of the suite for the same pattern. The three other unwrapped positive toHaveFocus assertions follow a synchronous fireEvent or an already-awaited findBy, so their focus is set before the assertion is reachable; they are left strict deliberately, since wrapping a deterministic assertion in waitFor would mask a real regression where focus arrives late. The two not.toHaveFocus assertions must stay unwrapped, as waitFor would pass on a state that could still change. Closes #694 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
enaboapps
force-pushed
the
fix/pairing-focus-flake-694
branch
from
September 8, 2026 14:38
3cb30ee to
60d5512
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #694.
The pairing-queue test failed intermittently on CI (Linux, full suite) while passing locally — it surfaced on the CI run for #693, a diff touching only
src/settings/, which cannot affect it. The same test passed 10/10 locally in isolation onmain.Cause
The final focus assertion was not wrapped in
waitFor, unlike the earlier one in the same test:PairingDialogmoves focus from a passive effect keyed onrequests(src/App.tsx):The preceding
waitForonly observes that the approved device's heading is gone. It does not guarantee that effect has run for the re-rendered dialog, so under CI load the assertion catches the intermediate state.Scan for the same pattern
All 15
toHaveFocusassertions in the suite were checked:App.test.tsx:390,:467,:480. Each follows either a synchronousfireEvent(React flushes the effect insideactbefore returning) or an already-awaitedfindBythat resolves in the same handler that moves focus. Their focus is set before the assertion is reachable, and wrapping a deterministic assertion inwaitForwould mask a real regression where focus arrives late.not.toHaveFocus()assertions insettings.test.tsx.waitForwould pass immediately on a state that could still change, inverting their meaning.Validation
npm run lintnpm test×5cargogatesThis is a test-only defect. The application's focus behavior is correct and unchanged.
🤖 Generated with Claude Code