Storybook a11y tests with Storybook Test Runner #383
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds testing using Storybook Test Runner and
axe-playwright
to the React component library. See Storybook's Accessibility tests page for background information.This new test run requires a running Storybook instance. With Storybook running locally at localhost:6006, run
npm run storybook-test
to see its output.Unlike in #368, I am unable to get the Select component to throw the error "ARIA hidden element must not be focusable or contain focusable elements." I'm unsure why this is so far. I've tried adding a manual delay to the
postVisit
step to see if it has something to do with the test runner hitting the page before the hidden element is rendered, and this didn't have any effect. More exploration required.Two genuine errors are being surfaced by this test suite: The stories
Button/Icon
andButton/PlaceholderIconButton
are both failing "Ensures buttons have discernible text". These will get addressed in a future PR.For now, I'm not adding the test run to any GitHub Actions workflow since the tests are failing.