Skip to content

feat: Add a11y test tooling, LiveRegion and span support for VisuallyHidden - #2615

Open
bprusinowski wants to merge 2 commits into
mainfrom
feat/a11y-tooling
Open

bprusinowski wants to merge 2 commits into
mainfrom
feat/a11y-tooling

Conversation

@bprusinowski

@bprusinowski bprusinowski commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Part of the GitLab a11y audit Prepares the fixes in the following PRs.

This PR adds:

  • expectNoAxeViolations helpers for vitest and Playwright (axe-core, WCAG 2.1 A/AA)
  • LiveRegion, a debounced polite status region for screen reader announcements
  • component="span" support in VisuallyHidden, for use inside buttons

How to test

  1. Run yarn test live-region visually-hidden.

  • I made a self-review of my own code
  • I wrote tests for the changes (if applicable)

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
visualization-tool Ready Ready Preview Nov 20, 2026 3:04pm UTC

Request Review

@mburri mburri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the setup.
See my comment on the asymetric WCAG coverage in tests.

Comment thread app/test/axe.ts
runOnly: { type: "tag", values: WCAG_TAGS },
rules: {
"color-contrast": { enabled: false },
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the color contrast rule disabled?
It is not disbled in e2e/a11y.ts - so e2e and axe tests may differ. Is this intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a look @mburri!

Yes, it's intentional – in jsdom, axe's color-contrast rule can't produce a result: it measures colors on a canvas (HTMLCanvasElement.getContext), which jsdom doesn't implement. I ran the unit axe specs with the rule enabled: 0 violations, every text node either errored into "incomplete" or wasn't checked at all, and even #ddd on white (1.6:1) wasn’t flagged.

Contrast is checked in e2e tests in a real browser, I've added a comment to explain 👍

This branch was successfully deployed

1 active deployment
Preview — df351790 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to 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.

2 participants