Repository navigation
test(operator): merge overlapping Settings and keyboard cases, check what they missed - #146
Merged
Merged
Conversation
…what they missed - One Settings case goes from a High snapshot to a confirmed All, in the dialog and the console label. - The Off / On case also checks the Pending menu item's aria-checked. - One ArrowDown case covers highlight, focus, the scrolled row container and approve-by-ID on a 3-row queue (replaces the liveNext focus case). - One case covers a pending_update replacing the whole queue: no visible highlight, and Enter sends nothing.
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.
Second frontend test cleanup from the test audit (audit at 6b65570; every case and behavior checked again on current main 6ad1ae5). Test-only: the diff is limited to
App.settings.test.tsx,App.liveNext.test.tsxandApp.interactions.test.tsx. No production code, generated bundles or audit outputs are included.Changes
Settings (
App.settings.test.tsx)shows the mode the snapshot reported, before anything is touchedandfollows the mode the server confirms, in both placesintoshows the mode the snapshot reported, then follows the mode the server confirms, in both places. The test mounts once with a High snapshot, checks the console label, opens Settings, checks High is pressed, delivers the All confirmation with the dialog open, checks All is pressed, closes the dialog and checks the label.App.test.tsx›applies the mode the server confirms, which starts from Off, is unchanged.keeps the Off / On control and the dialog on the same mode, with the same semantics: after Med+ and closing Settings, it now opens Pending options and checks that the auto-approvemenuitemcheckboxhasaria-checked="true".Keyboard navigation (
App.interactions.test.tsx,App.liveNext.test.tsx)3. Merged
moves the highlight down/up the queue and approves the highlighted item by IDand liveNext'safter an arrow moves the highlight past the first row, that row has focusintoArrowDown moves the highlight and focus row by row, scrolls that row into view, and Enter approves it by ID, using the 3-row queue. It checks:.is-selectedandaria-pressedon Romans and focuses itscrollIntoView({ block: 'nearest' })ran on the[data-cursor-row="p-2"]container, checked throughmock.contexts[{ approve, p-2 }]drops the highlight when the queue update no longer holds itandapproves nothing when a resumed queue no longer holds the highlighted IDintoa pending_update that replaces the whole queue drops the highlight, and Enter sends nothing. It selects the second row, replaces the queue with one unrelated row, then checks that no.is-selectedrow exists, the new row hasaria-pressed="false", and Enter sends nothing.Kept:
highlights the first item when arrowing up or down from no highlight,the arrows move the highlight, starting at the first row, held at the ends,drops the highlight when its detection leaves the queue(partial removal), thestate_snapshotreducer tests,Enter does nothing while the History tab hides the highlighted rowanddoes not approve the highlighted reference on Enter until Settings is closed.Findings and fault checks
Each fault was applied alone in a separate disposable checkout, run against the three files plus
operatorReducer.test.ts, then restored. On clean code all 109 tests in those four files pass.shows the mode the snapshot reported, then follows…(Higharia-pressed)keeps the Off / On control and the dialog…(aria-checked)ArrowDown moves the highlight and focus…(toHaveFocusafter the first ArrowDown); alsoa server update does not move focus or the highlightArrowDown moves the highlight and focus…(mock.contextsreceiver)ArrowDown moves the highlight and focus…(exact actions); also 4 other Enter testspending_updatekeeps a removed IDa pending_update that replaces the whole queue…(Enter sends nothing);drops the highlight when its detection leaves the queuea pending_update that replaces the whole queue…(no.is-selected)Enter does nothing while the History tab hides the highlighted row, and only that testdoes not approve the highlighted reference on Enter until Settings is closed; also theBtestignores … an open Settings dialogEach of the last two guards is caught by its own test. The Settings-reset fault also fails the two open-Settings keyboard tests, because the reset sends a
set_auto_modemessage.Timing (focused files, durations of the affected cases, 3 interleaved before/after runs)
These numbers are noisy run to run (for example, 1576–2589 ms for the seven original cases). The merged cases make the same
getByRolequeries as the originals, so there's no real speed-up. The value of this PR is fewer cases with stronger checks. Test counts: interactions + liveNext 51 → 49, settings 18 → 17.Checks
npm run lint,npm run typecheckandnpm run format:checkare clean.npm test -- --run: 66 files, 750 tests passed, 0 skipped.