Skip to content

Commit

Permalink
tests: Use const for reviewDetourButton
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahpurcell committed Oct 16, 2024
1 parent dfeea87 commit 6dfb9de
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions assets/tests/components/detours/diversionPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,13 @@ describe("DiversionPage", () => {
fireEvent.click(originalRouteShape.get(container))
})

expect(
screen.getByRole("button", { name: "Review", hidden: true })
).not.toBeVisible()
expect(reviewDetourButton.query()).not.toBeInTheDocument()

act(() => {
fireEvent.click(originalRouteShape.get(container))
})

expect(screen.getByRole("button", { name: "Review" })).toBeVisible()
expect(reviewDetourButton.get()).toBeVisible()
})

test.each<{
Expand Down Expand Up @@ -1212,7 +1210,7 @@ describe("DiversionPage", () => {
expect(
screen.queryByRole("button", { name: "Edit Detour" })
).not.toBeInTheDocument()
expect(screen.getByRole("button", { name: "Review" })).toBeVisible()
expect(reviewDetourButton.get()).toBeVisible()

expect(screen.getByRole("button", { name: "Undo" })).not.toBeDisabled()
expect(screen.getByRole("button", { name: "Clear" })).not.toBeDisabled()
Expand Down

0 comments on commit 6dfb9de

Please sign in to comment.