Skip to content

Commit 1ef0c67

Browse files
committed
fix(storybook-builder): support @storybook/addon-a11y
1 parent 18cc7bf commit 1ef0c67

File tree

6 files changed

+58
-1
lines changed

6 files changed

+58
-1
lines changed

.changeset/tame-forks-complain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@web/storybook-builder': patch
3+
---
4+
5+
support @storybook/addon-a11y

package-lock.json

Lines changed: 38 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/storybook-builder/src/rollup-plugin-prebundle-modules.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ export const CANDIDATES = [
9393
'react',
9494
'react-dom',
9595
'tocbot',
96+
97+
/* for @storybook/addon-a11y */
98+
'axe-core',
9699
];
97100

98101
function getReactDomShimAlias() {

packages/storybook-framework-web-components/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
},
6666
"devDependencies": {
6767
"@playwright/test": "^1.22.2",
68+
"@storybook/addon-a11y": "^7.0.0",
6869
"@storybook/addon-essentials": "^7.0.0",
6970
"@storybook/addon-interactions": "^7.0.0",
7071
"@storybook/addon-links": "^7.0.0",

packages/storybook-framework-web-components/tests/all-in-one.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ test.describe('all in one', () => {
4343
await expect(manager.toolbarItemByTitle('Apply outlines to the preview')).toBeVisible();
4444
});
4545

46+
test('renders @storybook/addon-a11y toolbar', async () => {
47+
await expect(manager.toolbarItemByTitle('Vision simulator')).toBeVisible();
48+
});
49+
4650
test('renders @storybook/addon-controls panel', async () => {
4751
const panelButton = manager.panelButtonByText('Controls');
4852
await panelButton.click();
@@ -60,4 +64,10 @@ test.describe('all in one', () => {
6064
await panelButton.click();
6165
await expect(panelButton).toHaveClass(/tabbutton-active/);
6266
});
67+
68+
test('renders @storybook/addon-a11y panel', async () => {
69+
const panelButton = manager.panelButtonByText('Accessibility');
70+
await panelButton.click();
71+
await expect(panelButton).toHaveClass(/tabbutton-active/);
72+
});
6373
});

packages/storybook-framework-web-components/tests/fixtures/all-in-one/.storybook/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const config = {
55
'@storybook/addon-essentials',
66
'@storybook/addon-links',
77
'@storybook/addon-interactions',
8+
'@storybook/addon-a11y',
89
],
910
framework: {
1011
name: '@web/storybook-framework-web-components',

0 commit comments

Comments
 (0)