Skip to content

chore(storybook): fail story tests on accessibility violations - #613

Merged
ggdaltoso merged 1 commit into
masterfrom
chore/storybook-a11y-error
Nov 12, 2026
Merged

ggdaltoso merged 1 commit into
masterfrom
chore/storybook-a11y-error

Conversation

@ggdaltoso

Copy link
Copy Markdown
Member

Closes #552

All the sub-issues of #552 are closed, so the story tests now fail on accessibility violations: a11y.test goes from 'todo' to 'error' in .storybook/preview.js.

One exception: the color-contrast rule skips the title of an inactive TitleBar. Since #590 the title uses headerNotActiveText, grey on grey like in Windows 95 (2.51:1 in the default theme), and WCAG exempts inactive components from the contrast minimum. Every other rule still checks it. The selector is built from the recipe's classNames, as TitleBar.css.ts already does, so it follows the class hashes.

With the exception, the 51 story tests pass with 'error'. Without it, 6 fail, all on that title (TitleBar, TaskBar, Modal and useModal stories). Making the active title low-contrast on purpose still fails TitleBar > Simple on color-contrast.

It only touches the Storybook config, so it doesn't publish a new @react95/core.

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@nx-cloud

nx-cloud Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 9433d1c

Command Status Duration Result
nx affected -t lint,test,build,test-storybook,b... ✅ Succeeded <1s View ↗
nx-cloud record -- yarn nx format:check ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-11 12:59:48 UTC

@ggdaltoso

Copy link
Copy Markdown
Member Author

Story tests with a11y.test: 'error', run locally on master:

Test files Tests
Without the exception 4 failed, 18 passed, 4 skipped 6 failed, 45 passed
With the exception (this PR) 22 passed, 4 skipped 51 passed

Without the exception, every failure is the same color-contrast violation: the inactive title, #c6c6c6 on #7f787f (2.51:1, expected 4.5:1). The stories that show an inactive window:

  • TitleBar › Inactive
  • TaskBar › Simple
  • Modal › Minimize, Stacking
  • useModal › Minimize Restore, Multiple Modals

To check that the rule still runs on everything else, I set the active title to #2a2aa0 on purpose: TitleBar › Simple failed on color-contrast (1.44:1), and passed again after reverting.

@ggdaltoso
ggdaltoso merged commit ee5e4ba into master Nov 12, 2026
9 checks passed
@ggdaltoso
ggdaltoso deleted the chore/storybook-a11y-error branch November 12, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix the accessibility violations found by the story tests

1 participant