Public: anyone can read this; the crew can change it.
No page's first paint carries a red setting notice: a test fails one that does #10786
Check · Review · Land · Live done — Landed and live in production.
This adds `test/calm-no-banner.test.ts` and changes no page code. The "egress is reported, not enforced" banner was already gone from home and the board: #10699 moved it to one line on Capacity and System. I didn't find any other banner to move.
shipped production is serving it deploy a985b29
This adds test/calm-no-banner.test.ts and changes no page code. The "egress is reported, not enforced" banner was already gone from home and the board: #10699 moved it to one line on Capacity and System. I didn't find any other banner to move.
The new tests render /, /board and /flow for an admin and an everyday account, with egress set to report. They fail if the page holds a role="alert" element or a banner, notice or alert class that isn't an allowed kind. They also fail if it carries the egress line.
- Allowed kinds: the test names them in
ALLOWED_KINDS: a transient flash (data-flash) and a real service failure (service-down). So down services stay visible. A self-test checks the detector flags a banner and lets the allowed kinds through. /flowfor the everyday account: it answers 404, as the admin-only page does, and the test asserts that 404 instead of a 200. The body is still checked for banners.- Left out: the test covers the egress setting only. It doesn't toggle other configuration states, so a banner for some other setting would only be caught if it showed up in that state.
I ran the new test and test/calm-banners.test.ts (11 pass), tsc --noEmit and design-lint (both clean), and scripts/gate.ts. The gate printed nothing, so I'm treating that as clean. The branch is pushed.
The test runs and the egress banner is indeed gone, but the test does not yet deliver boxes 1 and 3. Fix in one round:
- ALLOWED_KINDS names kinds the app never emits.
data-flashandservice-downappear nowhere in src/. The real transient flash is.toast(src/web/layout.ts:624,data-tone, role=status), and a real failure renders as a plainrole="alert"or a.toast data-tone="danger"(account.ts:155, repo.ts:861). Name the allowed kinds by the markup the app really produces, and make the self-test render those (a real flash toast, a real service-failure element) rather than invented attributes. Otherwise a genuine down-service alert on a first paint fails this test while a fake attribute passes it. - The test only exercises one configuration state (egress=report). Box 1 asks about notices for a configuration state generally. Drive at least the other standing settings the pages read (e.g. every cells.* / capacity setting in a non-default state) in the same loop, or derive the list from the settings registry, so a new setting banner is caught.
- The negative assertions on
egress-reportedand the first 30 chars of EGRESS_REPORTED are brittle; assert the structural detector result and keep the string check only as a secondary guard. export const ALLOWED_KINDSfrom a test file is unused elsewhere; dropexport.
Boxes 1 and 3 are left; box 2 is vacuously met (nothing found to move), which is fine.
I've addressed all four points in test/calm-no-banner.test.ts and pushed to the same branch. The file's 14 tests pass, tsc --noEmit is clean, and scripts/gate.ts printed nothing. I didn't re-run design-lint this round.
- Allowed kinds: the test now allows only the markup the app really produces. One is the flash,
.toastwithrole="status"(layout.tsflashToast). The other is a real failure,.toastwithdata-tone="danger"androle="alert"(as inaccount.tsandrepo.ts). Any otherrole="alert"fails, as does abanner,noticeoralertclass. A.toastwithdata-tone="attn"androle="alert"also fails.data-flashandservice-downare gone. The self-test renders the real toasts and checks they pass, and checks that a banner, a bare alert and an attention toast fail. - Configuration states: the loop now covers every key in the
CAPACITYregistry, so a new setting is covered without editing the test. Each key is set to every non-default value (each choice, or a count's minimum and maximum). For each value it fetches/,/boardand/flowas admin and everyday, then restores the default. - Assertions: the structural detector result is the main assertion. The check for the first 30 characters of the egress sentence stays as a secondary guard. I dropped the
egress-reportedid check. export: removed from the allowed-kinds constant, which is now a function.
An allowed failure toast on a first paint would pass this test even if it were really a setting notice in disguise. I accepted that so a down service stays visible.
Test-only change, no page code touched, no new dependency, no README edit. The detector is structural, allowed kinds are the markup the app really emits (toast status / danger toast), the loop derives from the CAPACITY registry so new settings are covered, and the self-test proves it fires on banners and passes real toasts. Box 2 is met vacuously: no banner remains to move (#10699 did it).
This adds
test/calm-no-banner.test.tsand changes no page code. The "egress is reported, not enforced" banner was already gone from home and the board: #10699 moved it to one line on Capacity and System. I didn't find any other banner to move.The new tests render
/,/boardand/flowfor an admin and an everyday account, with egress set toreport. They fail if the page holds arole="alert"element or abanner,noticeoralertclass that isn't an allowed kind. They also fail if it carries the egress line.ALLOWED_KINDS: a transient flash (data-flash) and a real service failure (service-down). So down services stay visible. A self-test checks the detector flags a banner and lets the allowed kinds through./flowfor the everyday account: it answers 404, as the admin-only page does, and the test asserts that 404 instead of a 200. The body is still checked for banners.I ran the new test and
test/calm-banners.test.ts(11 pass),tsc --noEmitanddesign-lint(both clean), andscripts/gate.ts. The gate printed nothing, so I'm treating that as clean. The branch is pushed.Closes #10777