-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(Link): add RTL, add a11y tests, add Accessibility Checker/Axe (#…
…7284) * test(Link): add RTL, add a11y tests, add AC * Update packages/react/src/components/Link/Link-test.js Co-authored-by: Josh Black <[email protected]> * Update packages/react/src/components/Link/Link-test.js Co-authored-by: Josh Black <[email protected]> * test(Link): change import style/use RTL cleanup * test(Link): change import style/use RTL cleanup Co-authored-by: Josh Black <[email protected]> Co-authored-by: TJ Egan <[email protected]>
- Loading branch information
1 parent
5f92371
commit 1253a6c
Showing
52 changed files
with
487 additions
and
6 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Link Component Accessibility Verification Testing | ||
|
||
Developers or designers wanting to manually verify the accessibility of the | ||
component can carry out the following steps: | ||
|
||
## Keyboard | ||
|
||
- [ ] the user can focus the link with `tab` | ||
- [ ] the user can activate the link with `enter` | ||
|
||
## Contrast | ||
|
||
- [ ] the link text has a contrast of 4.5:1 minimum against the background color | ||
- [ ] the link focus outline has a contrast of 4.5:1 minimum against the | ||
background color | ||
|
||
## Screen reader | ||
|
||
Each screen reader should be tested when paired with it's preferred browser. | ||
|
||
### VoiceOver on Safari | ||
|
||
"{link text}, link. You are currently on a link. To click this link, press | ||
Control-Option-Space." | ||
|
||
### JAWS on Edge/Chrome | ||
|
||
"Main region. {link text}, link." | ||
|
||
### NVDA on Firefox (optional, but recommended) | ||
|
||
"link {link 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
const aChecker = require('accessibility-checker'); | ||
|
||
async function toHaveNoACViolations(node, label) { | ||
let results = await aChecker.getCompliance(node, label); | ||
if (aChecker.assertCompliance(results.report) === 0) { | ||
return { | ||
pass: true, | ||
}; | ||
} else { | ||
return { | ||
pass: false, | ||
message: () => aChecker.stringifyResults(results.report), | ||
}; | ||
} | ||
} | ||
|
||
module.exports = toHaveNoACViolations; |
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.