forked from primer/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Radio): remove redundant aria-disabled (primer#2635)
* fix(Radio): remove redundant aria-disabled * test(e2e): refactor toHaveNoViolations to use axe-core directly for custom rules * test: update Radio test snapshots * chore: add changeset * test(vrt): update snapshots * test: update snapshots * chore: run prettier Co-authored-by: joshblack <[email protected]>
- Loading branch information
Showing
31 changed files
with
157 additions
and
67 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,5 @@ | ||
--- | ||
'@primer/react': patch | ||
--- | ||
|
||
Update Radio to only use disabled when provided and no longer set aria-disabled |
Binary file added
BIN
+12.8 KB
...nents/RadioGroup.test.ts-snapshots/RadioGroup-Default-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.8 KB
...omponents/RadioGroup.test.ts-snapshots/RadioGroup-Default-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.6 KB
...ts/RadioGroup.test.ts-snapshots/RadioGroup-Default-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.8 KB
...shots/components/RadioGroup.test.ts-snapshots/RadioGroup-Default-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.8 KB
...nents/RadioGroup.test.ts-snapshots/RadioGroup-Default-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.5 KB
...ioGroup.test.ts-snapshots/RadioGroup-Default-disabled-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.2 KB
.../RadioGroup.test.ts-snapshots/RadioGroup-Default-disabled-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.5 KB
...roup.test.ts-snapshots/RadioGroup-Default-disabled-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.5 KB
...ponents/RadioGroup.test.ts-snapshots/RadioGroup-Default-disabled-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.5 KB
...ioGroup.test.ts-snapshots/RadioGroup-Default-disabled-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.5 KB
...oGroup.test.ts-snapshots/RadioGroup-Default-disabled-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.6 KB
...oup.test.ts-snapshots/RadioGroup-Default-disabled-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.5 KB
...onents/RadioGroup.test.ts-snapshots/RadioGroup-Default-disabled-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.5 KB
...oGroup.test.ts-snapshots/RadioGroup-Default-disabled-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.6 KB
...ents/RadioGroup.test.ts-snapshots/RadioGroup-Default-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
...s/RadioGroup.test.ts-snapshots/RadioGroup-Default-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.6 KB
...hots/components/RadioGroup.test.ts-snapshots/RadioGroup-Default-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.6 KB
...ents/RadioGroup.test.ts-snapshots/RadioGroup-Default-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,81 @@ | ||
import {test, expect} from '@playwright/test' | ||
import {visit} from '../test-helpers/storybook' | ||
import {themes} from '../test-helpers/themes' | ||
|
||
test.describe('RadioGroup', () => { | ||
test.describe('Default', () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-forms-radiogroup-examples--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`RadioGroup.Default.${theme}.png`) | ||
}) | ||
|
||
test('disabled @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-forms-radiogroup-examples--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
args: { | ||
disabled: true, | ||
}, | ||
}) | ||
|
||
expect(await page.screenshot()).toMatchSnapshot(`RadioGroup.Default.disabled.${theme}.png`) | ||
|
||
await expect(page).toHaveNoViolations({ | ||
rules: { | ||
'color-contrast': { | ||
enabled: theme !== 'dark_dimmed', | ||
}, | ||
}, | ||
}) | ||
}) | ||
|
||
test('disabled @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-forms-radiogroup-examples--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
args: { | ||
disabled: true, | ||
}, | ||
}) | ||
|
||
await expect(page).toHaveNoViolations({ | ||
rules: { | ||
'color-contrast': { | ||
enabled: theme !== 'dark_dimmed', | ||
}, | ||
}, | ||
}) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: 'components-forms-radiogroup-examples--default', | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations({ | ||
rules: { | ||
'color-contrast': { | ||
enabled: theme !== 'dark_dimmed', | ||
}, | ||
}, | ||
}) | ||
}) | ||
}) | ||
} | ||
}) | ||
}) |
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
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
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
Oops, something went wrong.