You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: add component a11y unit tests (jest-axe) (#13613)
* test: add component a11y unit tests (jest-axe)
Cover 14 components in two waves. 16 tests fail by design - each
encodes a known gap from a11y-action-plan (phases 0-3) and flips to
a regression lock once the component fix lands. 23 tests pass as
regression locks for already-correct semantics.
* ci: split a11y unit tests into separate workflow
Main jest CI excludes *.a11y.test.* so known-gap failures don't
block PRs; new a11y-unit-tests.yml runs them as informational check.
* fix(a11y): resolve component gaps flagged by a11y unit tests
Fixes all 16 failing jest-axe gap tests:
- TableHead defaults scope=col
- alert display area gets aria-live region
- app header becomes <header> landmark; bell button labeled
- icon wrapper decorative by default (aria-hidden), ariaLabel opt-in
- Input drops wrapping <label> (name pollution) and hides placeholder span
- password toggle back in tab order with aria-label/aria-pressed
- CheckBoxDiv exposes checkbox role + state
- accordion trigger renders native Radix button
- dialogs focus container on open instead of suppressing autofocus
- full-screen modal exposes dialog role/aria-modal/ariaLabel
- flow list card focusable with keyboard activation
Also wraps test focus calls in act() and mocks the icon loader so
the a11y suite runs without React warnings.
* fix: skip Puppeteer Chrome download in remaining Dockerfiles
frontend and base images still ran bare npm install; puppeteer (via
accessibility-checker, test-only) tried to fetch Chrome and broke the
Docker image build in CI.
* test: extend a11y unit test coverage (jest-axe)
Adds axe + semantics tests for untested primitives (button, alert,
textarea, radio-group, dropdown-menu, tooltip, popover) and two
known-gap tests that fail by design until fixes land:
- copyFieldAreaComponent copy action is a bare div onClick (plan 2.4)
- DialogContentWithouFixed renders an empty fragment (plan 1.6)
* fix: make webhook copy field a real button (a11y)
Copy action was a bare div onClick - no role, name, or keyboard
support (a11y-action-plan 2.4). Drops the no-longer-needed
DialogContentWithouFixed known-gap test.
* feat: update a11y unit tests and improve accessibility semantics in components
* feat: enable pull request trigger for a11y scan workflow
5. Map findings back to IBM Equal Access `Level 1` scope in the audit docs.
145
+
146
+
---
147
+
148
+
## Component-level a11y unit tests (jest-axe)
149
+
150
+
Second tier next to the IBM page scans. Runs on every PR in its own workflow
151
+
(`.github/workflows/a11y-unit-tests.yml`, `make test_frontend_a11y_ci`). All
152
+
tests pass as of the fixes in this branch and act as regression locks: a
153
+
failure blocks the PR. The main Jest workflow excludes `*.a11y.test.*` files.
154
+
155
+
> **jsdom limitations — not a compliance signal.** jest-axe runs in jsdom,
156
+
> which has no layout engine: color contrast, focus-visible styling, and
157
+
> anything canvas-based (ReactFlow nodes/edges) are **not** covered here and
158
+
> stay with the IBM Playwright scans. A green jest-axe run means the tested
159
+
> DOM semantics are correct, not that the component is WCAG-compliant.
160
+
161
+
- Matcher: `toHaveNoViolations` is registered globally in [src/frontend/src/setupTests.ts](/Users/viktoravelino/projects/langflow/src/frontend/src/setupTests.ts)
162
+
- Shared axe instance: [src/frontend/src/utils/a11y-test.ts](/Users/viktoravelino/projects/langflow/src/frontend/src/utils/a11y-test.ts) (`color-contrast` disabled — jsdom has no layout; contrast stays with the IBM checker)
163
+
- File convention: `<component>.a11y.test.tsx` inside the component's `__tests__/` folder
164
+
- New known gaps should be encoded as regular tests asserting the semantics the component *should* have, and land **together with the component fix** — the workflow blocks on failures, so a red test means a regression (or a fix that hasn't landed yet)
0 commit comments