-
-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix disabled events when using the
as
prop (#736)
- Loading branch information
Showing
9 changed files
with
314 additions
and
101 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
56 changes: 56 additions & 0 deletions
56
packages/reakit/src/Composite/__examples__/CompositeVirtualAsProp/__tests__/index-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,56 @@ | ||
import * as React from "react"; | ||
import { render, press, screen, axe } from "reakit-test-utils"; | ||
import CompositeVirtualAsProp from ".."; | ||
|
||
test("navigate through composite items", () => { | ||
render(<CompositeVirtualAsProp />); | ||
press.Tab(); | ||
press.ArrowDown(); | ||
expect(screen.getByLabelText("events")).toMatchInlineSnapshot(` | ||
<ul | ||
aria-label="events" | ||
> | ||
<li> | ||
focus Item 1 | ||
</li> | ||
<li> | ||
focus composite - Item 1 | ||
</li> | ||
<li> | ||
focus composite | ||
</li> | ||
<li> | ||
keyup composite (Tab) | ||
</li> | ||
<li> | ||
keydown Item 1 (ArrowDown) | ||
</li> | ||
<li> | ||
keydown composite - Item 1 (ArrowDown) | ||
</li> | ||
<li> | ||
blur Item 1 | ||
</li> | ||
<li> | ||
blur composite - Item 1 | ||
</li> | ||
<li> | ||
focus Item 2 | ||
</li> | ||
<li> | ||
focus composite - Item 2 | ||
</li> | ||
<li> | ||
keyup Item 2 (ArrowDown) | ||
</li> | ||
<li> | ||
keyup composite - Item 2 (ArrowDown) | ||
</li> | ||
</ul> | ||
`); | ||
}); | ||
|
||
test("a11y", async () => { | ||
const { baseElement } = render(<CompositeVirtualAsProp />); | ||
expect(await axe(baseElement)).toHaveNoViolations(); | ||
}); |
Oops, something went wrong.