From 880ea9269086d2f43d8eac0ca1ea39743374f5ab Mon Sep 17 00:00:00 2001 From: Kyzyl-ool Kezhik Date: Tue, 23 Apr 2024 14:42:26 +0200 Subject: [PATCH] ci(storybook): fix a11y issues (#1538) Co-authored-by: Kezhik Kyzyl-ool --- .storybook/test-runner.ts | 2 ++ .../Button/__stories__/Button.stories.tsx | 2 +- .../Divider/__stories__/Divider.stories.tsx | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.storybook/test-runner.ts b/.storybook/test-runner.ts index 2d42a0b921..f4eae1c4cb 100644 --- a/.storybook/test-runner.ts +++ b/.storybook/test-runner.ts @@ -17,9 +17,11 @@ const config: TestRunnerConfig = { // Apply story-level a11y rules await configureAxe(page, { rules: storyContext.parameters?.a11y?.config?.rules, + reporter: 'no-passes', }); await checkA11y(page, '#storybook-root', { + verbose: false, detailedReport: true, detailedReportOptions: { html: true, diff --git a/src/components/Button/__stories__/Button.stories.tsx b/src/components/Button/__stories__/Button.stories.tsx index 13e4888f5a..68a5363f5a 100644 --- a/src/components/Button/__stories__/Button.stories.tsx +++ b/src/components/Button/__stories__/Button.stories.tsx @@ -180,7 +180,7 @@ export const InsideText: Story = { {' '} amet diff --git a/src/components/Divider/__stories__/Divider.stories.tsx b/src/components/Divider/__stories__/Divider.stories.tsx index ed948837e7..16e89a446b 100644 --- a/src/components/Divider/__stories__/Divider.stories.tsx +++ b/src/components/Divider/__stories__/Divider.stories.tsx @@ -11,6 +11,23 @@ import {Divider} from '../Divider'; const meta: Meta = { title: 'Components/Utils/Divider', component: Divider, + parameters: { + a11y: { + element: '#storybook-root', + config: { + rules: [ + { + id: 'aria-allowed-attr', // https://github.com/gravity-ui/uikit/issues/1336 + enabled: false, + }, + { + id: 'aria-required-parent', // https://github.com/gravity-ui/uikit/issues/1336 + enabled: false, + }, + ], + }, + }, + }, }; export default meta;