Skip to content

Commit 1816eaf

Browse files
ovflowdavivkeller
andauthored
feat(ui-components): add accessibility testing to storybook (#9205)
* feat(ui-components): add accessibility testing to storybook Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(ui-components): align a11y addon with storybook 10.6.0, add empty changeset Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> * Delete .changeset/witty-pants-own.md Signed-off-by: Aviv Keller <me@aviv.sh> --------- Signed-off-by: Aviv Keller <me@aviv.sh> Co-authored-by: Aviv Keller <me@aviv.sh>
1 parent 736fed1 commit 1816eaf

4 files changed

Lines changed: 49 additions & 186 deletions

File tree

‎packages/ui-components/.storybook/main.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const config: StorybookConfig = {
1818
addons: [
1919
'@storybook/addon-webpack5-compiler-swc',
2020
'@storybook/addon-themes',
21+
'@storybook/addon-a11y',
2122
{
2223
name: '@storybook/addon-styling-webpack',
2324
options: {

‎packages/ui-components/.storybook/preview.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ const preview: Preview = {
1212
viewport: {
1313
options: STORYBOOK_SIZES,
1414
},
15+
// Runs axe-core against every Story and reports WCAG violations in the
16+
// Accessibility panel. 'todo' surfaces them as warnings instead of failures
17+
// @see https://storybook.js.org/docs/writing-tests/accessibility-testing
18+
a11y: { test: 'todo' },
1519
},
1620

1721
decorators: [

‎packages/ui-components/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"devDependencies": {
6868
"@eslint-react/eslint-plugin": "~5.8.6",
6969
"@orama/core": "^1.2.19",
70+
"@storybook/addon-a11y": "~10.6.0",
7071
"@storybook/addon-styling-webpack": "~3.0.2",
7172
"@storybook/addon-themes": "~10.6.0",
7273
"@storybook/addon-webpack5-compiler-swc": "~4.0.3",

0 commit comments

Comments
 (0)