Skip to content

Commit 0747c9f

Browse files
authored
chore: add storybook a11y plugin (#30763)
1 parent 08487aa commit 0747c9f

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { mergeConfig } from "vite";
1313
const config: StorybookConfig = {
1414
stories: ["../src/shared-components/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
1515
staticDirs: ["../webapp"],
16-
addons: ["@storybook/addon-docs", "@storybook/addon-designs"],
16+
addons: ["@storybook/addon-docs", "@storybook/addon-designs", "@storybook/addon-a11y"],
1717
framework: "@storybook/react-vite",
1818
core: {
1919
disableTelemetry: true,

.storybook/preview.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ const preview: Preview = {
100100
method: "alphabetical",
101101
},
102102
},
103+
a11y: {
104+
/*
105+
* Configure test behavior
106+
* See: https://storybook.js.org/docs/next/writing-tests/accessibility-testing#test-behavior
107+
*/
108+
test: "error",
109+
},
103110
},
104111
};
105112

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
"@principalstudio/html-webpack-inject-preload": "^1.2.7",
192192
"@rrweb/types": "^2.0.0-alpha.18",
193193
"@sentry/webpack-plugin": "^4.0.0",
194+
"@storybook/addon-a11y": "^9.0.18",
194195
"@storybook/addon-designs": "^10.0.1",
195196
"@storybook/addon-docs": "^9.0.12",
196197
"@storybook/icons": "^1.4.0",

yarn.lock

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3504,6 +3504,14 @@
35043504
dependencies:
35053505
"@sinonjs/commons" "^3.0.0"
35063506

3507+
"@storybook/addon-a11y@^9.0.18":
3508+
version "9.1.6"
3509+
resolved "https://registry.yarnpkg.com/@storybook/addon-a11y/-/addon-a11y-9.1.6.tgz#a7e253c5a1a381eb4aaeecd47345e935f54cdda4"
3510+
integrity sha512-jpuzbZlT8G1hx4N6nhhmxy6Lu+Xnz1oeGb2/pm+rKx2fZ4oy7yGRliRNOvpTy8MbkpnfMoLLrcqc66s/kfdf3A==
3511+
dependencies:
3512+
"@storybook/global" "^5.0.0"
3513+
axe-core "^4.2.0"
3514+
35073515
"@storybook/addon-designs@^10.0.1":
35083516
version "10.0.2"
35093517
resolved "https://registry.yarnpkg.com/@storybook/addon-designs/-/addon-designs-10.0.2.tgz#b889a3b67d88f1cf7a4744865241ea61b88cd760"
@@ -5437,7 +5445,7 @@ axe-core@^4.10.0:
54375445
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.10.2.tgz#85228e3e1d8b8532a27659b332e39b7fa0e022df"
54385446
integrity sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w==
54395447

5440-
axe-core@~4.10.3:
5448+
axe-core@^4.2.0, axe-core@~4.10.3:
54415449
version "4.10.3"
54425450
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.10.3.tgz#04145965ac7894faddbac30861e5d8f11bfd14fc"
54435451
integrity sha512-Xm7bpRXnDSX2YE2YFfBk2FnF0ep6tmG7xPh8iHee8MIcrgq762Nkce856dYtJYLkuIoYZvGfTs/PbZhideTcEg==

0 commit comments

Comments
 (0)