Conversation
Add a fragment-scoped accessibility guard to the web app test suite: server-rendered component trees run through axe-core in jsdom with no browser, network, or credentials. First coverage: the @facility/ui primitives, labeled form controls, CI status text, and markdown evidence. The guard found one latent issue on first run: Callout hardcodes an h3, so it skips heading order under an h1 without an h2. The fixture documents that constraint; making the level configurable stays with the issue. Refs theam#331
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.
Refs #331. First slice of the accessibility guard proposed there.
What changes
Adds
apps/web/test/a11y.test.tsx: a fragment-scoped axe-core guard in the default web test suite. Component trees are server-rendered withrenderToStringinto a jsdom fragment and run through axe. No browser, network, or credentials, so it fits the deterministic default suite.docs/testing.mddocuments the tier and its boundary: color contrast, focus order, page-level landmarks, and keyboard flows stay with the manual browser pass.First coverage:
@facility/uiprimitives (Button, ButtonLink, PillTag, Callout, Terminal, Metric, Field with all three controls, LegendChip, StatusDot, Eyebrow, NumeralAnchor, Divider),CiStatusLink, and theMarkdownevidence renderer.Two dev-only dependencies are added to
apps/web:axe-coreandjsdom. They resolve through the lockfile supply-chain policy without exceptions.The guard caught something on its first run
Callouthardcodes an<h3>(packages/ui/src/primitives.tsx:134). Under a page<h1>with no<h2>in between, heading order skips a level and axe fails. The test fixture documents the constraint by including the<h2>. WhetherCalloutshould accept a configurable level is left to the issue.Verification
pnpm --filter @facility/web test— 6 files, 36 tests passed (4 new)pnpm --filter @facility/web typecheck— cleanpnpm exec biome check apps/web/test/a11y.test.tsx apps/web/package.json docs/testing.md— clean after auto-fix of import orderpnpm --filter @facility/web build— cleannode guards/run.mjs— 2 guards ran, 0 failedpnpm install— lockfile passes supply-chain policiesNot run: full
pnpm verify(needs local PostgreSQL via Docker; this change touches no API, database, or workspace boundary) and the manual browser pass (no runtime behavior changed).Effects
apps/webtests.test:— no release on its own.