Skip to content

Commit

Permalink
Streamline test
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Moore committed Dec 2, 2024
1 parent d73a700 commit 284a4ea
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,7 @@ export const FocusOnFlip: Story = {
})

await step("initial render complete", async () => {
await waitFor(() => {
canvas.getByRole("button", {
name: "View more information: Title",
})
})
expect(buttonWithInfoLabel).toBeInTheDocument()
})

await step("Can focus to button", async () => {
Expand All @@ -136,11 +132,14 @@ export const FocusOnFlip: Story = {
name: "Hide information: Title",
})

expect(returnButton).toHaveFocus()

await step("Can focus to info button again", async () => {
await step("Can click on info button again", async () => {
await waitFor(() => {
returnButton.click()
})
})

await step("Info button has focus again", async () => {
await waitFor(() => {
expect(buttonWithInfoLabel).toHaveFocus()
})
})
Expand Down

0 comments on commit 284a4ea

Please sign in to comment.