-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Axe] Run axe across all stories (#5592)
* Run storybook axe scans on CI * test * clean * remove console * rephrase id * unused * edits * try * test * test * store * store * store * fic * fix vrt * fix axe violation * fix * test * test * ActionMenu story fix * Header axe violations * fix aria-label * Eanable SelectPanel feature flag for FilteredActionList Story * format + lint + remove cli changes * lint * lint * unique aria-labels on banner * replace link with button on deprecated storybook example * ts-ignore message * ts-ignore message * remove parantheses from file names * Potential fix for code scanning alert no. 8: Replacement of a substring with itself Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * remove / * remove / * remove space * Update e2e/components/Axe.test.ts Co-authored-by: Josh Black <[email protected]> * add test skip * add test skip * add progressbar fix --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Josh Black <[email protected]>
- Loading branch information
1 parent
59e0efa
commit 92d7771
Showing
15 changed files
with
92 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import {test, expect} from '@playwright/test' | ||
// @ts-ignore since this file is generated in the ci to generate this file run npx build storybook in packages/react | ||
import componentsConfig from '../../packages/react/storybook-static/index.json' | ||
import {visit} from '../test-helpers/storybook' | ||
import {themes} from '../test-helpers/themes' | ||
|
||
/** | ||
* These stories should not be tested in the CI because they are stress-tests and | ||
* perform slowly | ||
*/ | ||
const SKIPPED_TESTS = [ | ||
'components-treeview-features--stress-test', | ||
'components-treeview-features--contain-intrinsic-size', | ||
'components-flash-features--with-icon-action-dismiss', // TODO: Remove once color-contrast issues have been resolved | ||
'components-flash-features--with-icon-and-action', // TODO: Remove once color-contrast issues have been resolved | ||
] | ||
|
||
type Component = { | ||
name: string | ||
} | ||
|
||
const {entries} = componentsConfig | ||
|
||
test.describe('@aat', () => { | ||
for (const [id, entry] of Object.entries(entries as Record<string, Component>)) { | ||
if (SKIPPED_TESTS.includes(id)) { | ||
continue | ||
} | ||
|
||
const {name} = entry | ||
// remove parentheses and slashes from the name to avoid playwright file issues | ||
// eslint-disable-next-line no-useless-escape | ||
const cleanedName = name.replaceAll(/[\(\)\/]/g, '') | ||
|
||
test.describe(id, () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test(`${cleanedName} @aat`, async ({page}) => { | ||
await visit(page, { | ||
id, | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
} | ||
}) |
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
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
.HeaderDev { | ||
background-color: var(--label-olive-bgColor-active); | ||
color: var(--color-prettylights-syntax-carriage-return-text); | ||
/* stylelint-disable-next-line primer/no-display-colors */ | ||
background-color: var(--display-pine-bgColor-emphasis); | ||
} | ||
|
||
.HeaderDevItem { | ||
padding-left: var(--base-size-24); | ||
} | ||
|
||
.HeaderDevLink { | ||
color: var(--color-prettylights-syntax-markup-inserted-text); | ||
color: var(--color-prettylights-syntax-carriage-return-text); | ||
} |
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
17 changes: 0 additions & 17 deletions
17
packages/react/src/UnderlineNav/UnderlineNav.dev.stories.tsx
This file was deleted.
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
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