Skip to content

Commit

Permalink
ci(storybook): fix a11y issues (#1538)
Browse files Browse the repository at this point in the history
Co-authored-by: Kezhik Kyzyl-ool <[email protected]>
  • Loading branch information
Kyzyl-ool and Kezhik Kyzyl-ool authored Apr 23, 2024
1 parent f916681 commit 6dc2720
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .storybook/test-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/__stories__/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const InsideText: Story = {
<Button {...args} /> dolor
<br />
sit{' '}
<Button {...args}>
<Button {...args} extraProps={{'aria-label': 'Icon button inside text'}}>
<IconComponent data={Globe} />
</Button>{' '}
amet
Expand Down
17 changes: 17 additions & 0 deletions src/components/Divider/__stories__/Divider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ import {Divider} from '../Divider';
const meta: Meta<typeof Divider> = {
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;
Expand Down

0 comments on commit 6dc2720

Please sign in to comment.