-
-
Notifications
You must be signed in to change notification settings - Fork 287
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Please provide the environment you discovered this bug in.
- use
https://github.com/brandonroberts/angular-vite-storybook
- add a11y addon
npm add -D @storybook/addon-a11y
- add
'@storybook/addon-a11y'
toaddons
in.storybook/main.ts
- add
a11y: { test: 'error', }
toparameters
in.storybook/preview.ts
- update
.storybook/vitest.setup.ts
([Docs]: It's unclear that addon-a11y + addon-vitest requires additional setup invitest.setup.ts
storybookjs/storybook#31700 (comment))import * as addonA11y from '@storybook/addon-a11y/preview'; setProjectAnnotations([projectAnnotations, addonA11y])
set primary button's color.storybook-button--primary
to#222222
insrc/stories/button.css
npx vitest
- see no a11y errors
- open storybook and see color contrast violation for primary button in a11y tab
- run a11y tests in storybook ui and see no errors
Which area/package is the issue in?
vitest-angular
Description
I haven't debuged this too deep, but for me it looks like afterEach
function from @storybook/addon-a11y/preview
is not called with this setup.
Just in case I've checked the minimum setup with clean react + vite and that afterEach
is called there and a11y errors are successfully reported both in cli and in storybook ui.
Please provide the exception or error you saw
Other information
No response
I would be willing to submit a PR to fix this issue
- Yes
- No
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working