forked from reach/reach-ui
-
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.
- Loading branch information
Chance Strickland
committed
Mar 10, 2020
1 parent
2f3c7ca
commit fd8102b
Showing
4 changed files
with
43 additions
and
0 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
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
18 changes: 18 additions & 0 deletions
18
packages/visually-hidden/__tests__/visually-hidden.test.tsx
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,18 @@ | ||
import React from "react"; | ||
import { render, cleanup } from "$test/utils"; | ||
import { axe } from "jest-axe"; | ||
import VisuallyHidden from "@reach/visually-hidden"; | ||
|
||
describe("<VisuallyHidden />", () => { | ||
it("should not have basic a11y issues", async () => { | ||
const { container } = render( | ||
<button onClick={() => void null}> | ||
<VisuallyHidden>Click Me</VisuallyHidden> | ||
<span aria-hidden>👏</span> | ||
</button> | ||
); | ||
const results = await axe(container); | ||
expect(results).toHaveNoViolations(); | ||
cleanup(); | ||
}); | ||
}); |