-
Notifications
You must be signed in to change notification settings - Fork 27.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dev-overlay] add a11y test (#75523)
Added a11y test, but haven't enabled for the CI. Will follow up to resolve the test result.  You can manually test a11y at the storybook portal: https://github.com/user-attachments/assets/72929e65-bd70-481e-ac2f-1b518c344373 Closes https://linear.app/vercel/issue/NDX-584/add-a11y-tests
- Loading branch information
1 parent
e86c59c
commit dbce745
Showing
8 changed files
with
123 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { TestRunnerConfig } from '@storybook/test-runner' | ||
import { injectAxe, checkA11y } from 'axe-playwright' | ||
|
||
/* | ||
* See https://storybook.js.org/docs/writing-tests/test-runner#test-hook-api | ||
* to learn more about the test-runner hooks API. | ||
*/ | ||
const config: TestRunnerConfig = { | ||
async preVisit(page) { | ||
await injectAxe(page) | ||
}, | ||
async postVisit(page) { | ||
await checkA11y(page, 'nextjs-portal', { | ||
detailedReport: true, | ||
detailedReportOptions: { | ||
html: true, | ||
}, | ||
}) | ||
}, | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
const { getJestConfig } = require('@storybook/test-runner') | ||
|
||
// The default Jest configuration comes from @storybook/test-runner | ||
const testRunnerConfig = getJestConfig() | ||
|
||
/** | ||
* @type {import('@jest/types').Config.InitialOptions} | ||
*/ | ||
module.exports = { | ||
...testRunnerConfig, | ||
/** Add your own overrides below, and make sure | ||
* to merge testRunnerConfig properties with your own | ||
* @see https://jestjs.io/docs/configuration | ||
*/ | ||
rootDir: '<rootDir>/../src/client/components/react-dev-overlay/', | ||
testMatch: ['**/*.stories.tsx', '**/*.test.tsx'], | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters