diff --git a/.storybook/public/mockServiceWorker.js b/.storybook/public/mockServiceWorker.js index a8262f0..cec5322 100644 --- a/.storybook/public/mockServiceWorker.js +++ b/.storybook/public/mockServiceWorker.js @@ -8,7 +8,7 @@ * - Please do NOT serve this file on production. */ -const PACKAGE_VERSION = '2.4.9' +const PACKAGE_VERSION = '2.4.10' const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423' const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') const activeClientIds = new Set() diff --git a/test-runner.ts b/test-runner.ts index 99cb29b..be48acc 100644 --- a/test-runner.ts +++ b/test-runner.ts @@ -1,11 +1,20 @@ -import type { TestRunnerConfig } from '@storybook/test-runner'; -import { injectAxe, checkA11y } from 'axe-playwright'; +import { + getStoryContext, + type TestRunnerConfig, +} from '@storybook/test-runner'; +import { injectAxe, checkA11y, configureAxe } from 'axe-playwright'; const config: TestRunnerConfig = { async preVisit(page) { await injectAxe(page); }, - async postVisit(page) { + async postVisit(page, context) { + const storyContext = await getStoryContext(page, context); + + await configureAxe(page, { + rules: storyContext.parameters?.a11y?.config?.rules, + }); + await checkA11y(page, '#storybook-root', { detailedReport: true, detailedReportOptions: {