Skip to content

Cover NotificationSettings component wiring, incl. status-slot cross-wiring - #810

Merged
selfcontained merged 1 commit into
mainfrom
agt_93ff121821dd/job-test-enforcer-0c9beede
Jul 22, 2026
Merged

Cover NotificationSettings component wiring, incl. status-slot cross-wiring#810
selfcontained merged 1 commit into
mainfrom
agt_93ff121821dd/job-test-enforcer-0c9beede

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

Recurring test-enforcer run. The local suite was green on the first pass (check clean; server 2292 pass / 8 skip, web 268, browser-ext 51; E2E 169 pass / 12 skip), the flakes list was empty, and the CI scan surfaced no real flakes. So this run spends its effort on the highest-value missing coverage per the carried-forward next_focus.

PR #805 covered the useNotificationSettings hook, but the NotificationSettings component that wires it into the browser/Slack sections had no direct unit coverage — it was exercised only through E2E. This adds a focused component test that renders the real hook with only its api + web-notifications seams mocked, and asserts the wiring rather than re-testing hook logic.

Tests added (apps/web/src/components/app/notification-settings.test.tsx, 7 tests)

  • Save gating — disabled when the form matches the saved baseline, enabled once dirty, shows the transient Saving.../disabled state, and re-baselines back to disabled after the server response (asserting the real POST payload, not the mock's echo).
  • Browser toggle wiring — flipping the enable switch drives the browser-settings POST (enabled flag + events only) and renders its saved message in the Browser section.
  • Status slots do not cross-wire (the headline gap) — a browser-save failure surfaces webError only in the Browser section; a Slack-save failure surfaces error only in the Slack section. A mis-wired prop (webError/error swapped between sections) is the exact silent bug these guard against.
  • Permission gating — the enable toggle, event toggles, and test button stay behind the granted-permission gate, including the "saved enabled flag outlives its permission" edge.

Verified non-vacuous against 6 source mutations (two cross-wire swaps, Save-ignores-hasChanges, checkbox permission gate, test-button permission gate) — all caught.

CI-scan note

The only recent CI failures were 4 pre-merge iterations of PR #808 (agent-crud.spec.ts:210 pins deep-equality), fixed by the author before merge — deterministic (pins are written in a single synchronous INSERT), not a flake. No new flake entries were recorded.

Validation

pnpm run check, pnpm run finalize:web, and the full unit suite (web 268 → 275) all green. No product code changed, so E2E is unaffected (169 pass / 12 skip at the start of the run).

🤖 Generated with Claude Code

…wiring
PR #805 covered the useNotificationSettings hook; the component that wires it
into the browser/Slack sections had no direct unit coverage. Add a component
test that renders NotificationSettings with only its api + web-notifications
seams mocked, asserting the wiring rather than re-testing hook logic:
- Save gates on hasChanges and reflects the transient saving state.
- A browser-notification toggle drives the browser-settings POST and its
saved message renders in the Browser section.
- webMessage/webError render in the Browser section and message/error in the
Slack section — neither status slot cross-wires into the other (the silent
bug a mis-wired prop would produce).
- The enable toggle, event toggles, and test button stay behind the granted
permission gate, including when a saved enabled flag outlives its permission.
Verified non-vacuous against 6 source mutations (two cross-wire swaps,
Save-ignores-hasChanges, checkbox/test-button permission gates) — all caught.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@selfcontained
selfcontained merged commit 98d0fa9 into mainJul 22, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_93ff121821dd/job-test-enforcer-0c9beede branch July 22, 2026 02:22
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