Skip to content

Cover the settings pane's routing and its admin gate - #995

Merged
selfcontained merged 1 commit into
mainfrom
agt_c1e0c38a4820/job-test-enforcer-bc391540
Aug 23, 2026
Merged

Cover the settings pane's routing and its admin gate#995
selfcontained merged 1 commit into
mainfrom
agt_c1e0c38a4820/job-test-enforcer-bc391540

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Recurring test-enforcer run. The local suite was green on the first pass (35th consecutive), the flakes list was empty for the 13th run running, and the CI scan turned up no new failures — so the whole run went to the coverage target the last run queued up: settings-pane.tsx, plus the settings-state.ts hook that feeds it.

Between them these two modules own which settings panel the operator sees, the isAdmin gate that keeps the Releases admin panel away from non-admins, the docs sub-nav, and the update stream that has to outlive a trip away from the Updates tab. Neither had a test.

settings-state.test.ts (13 tests)

Drives useSettingsState through route resolution (missing, unknown, and valid sections), the admin check, the nav list it composes from the verdict, and the bounce that parks a non-admin who deep-links to /settings/releases on General — then lands them back on Releases once the check confirms access.

settings-pane.test.tsx (27 tests)

Mounts both exported components with every settings panel replaced by a marker that records the props it was handed, so the assertions reach the routing table, the keyed scroll container, the docs sub-nav guard, the service dots, and the wiring tsc cannot check — two same-typed callbacks handed to the wrong child.

Mutation battery

50 mutants, 50 killed.

One mutant survived the first pass: dropping key={activeSection} from the scroll container. Rather than record it as unobservable, I checked the assumption — jsdom does no layout, but it does store a written scrollTop, so the behavior was reachable and the test was sharpened into a real scroll-reset assertion instead.

The review pass then proved two assertions could not fail, and both are fixed:

  • The update-stream ownership test — the one the commit leaned on hardest — stayed green with useReleaseStream deleted from the component outright. The stub props map was never cleared between tests, so both sides of the identity check read undefined. The map is now cleared per test, the assertion guards on the panel actually being mounted, and a sharper sibling asserts the subscription happens while a different section is showing, which is the whole point of owning it here.
  • IdeSettings' onChange was never round-tripped, so rewiring it to a stray closure was type-correct and undetected. Both enablement panels now round-trip.

Both regressions are in the battery above and both are killed.

Validation

pnpm run check, pnpm run format, pnpm run lint:web (0 errors), pnpm run test (server 164 files/2808, web 74/1130, ext 9/60), pnpm run test:e2e (181 passed/12 skipped), pnpm run test:e2e:live (11 passed, 20.6s, zero leaked e2e-* tmux sessions), pnpm run finalize:web.

No product code changed in this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Hwpaeh6Kc7u3EFaRvywtUb

`settings-pane.tsx` and `settings-state.ts` had no tests. Between them they
own which settings panel the operator sees, the `isAdmin` gate that keeps the
Releases admin panel away from non-admins, the docs sub-nav, and the update
stream that has to outlive a trip away from the Updates tab.
`settings-state.test.ts` drives `useSettingsState` through route resolution
(missing, unknown and valid sections), the admin check, the nav list it
composes from the verdict, and the bounce that parks a non-admin who deep
links to `/settings/releases` on General until the check confirms access.
`settings-pane.test.tsx` mounts both exported components with every panel
replaced by a marker that records its props, so the assertions cover the
routing table, the wiring that `tsc` cannot check (two same-typed callbacks
handed to the wrong child), the keyed scroll container, and the release
stream's identity across a section switch.
46 mutants, 46 killed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hwpaeh6Kc7u3EFaRvywtUb
@selfcontained
selfcontained merged commit c39bd80 into mainAug 23, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_c1e0c38a4820/job-test-enforcer-bc391540 branch August 23, 2026 02:34
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@selfcontained