From 6dfb9de81cf2d8889455f6bd7e0bf65af78b7461 Mon Sep 17 00:00:00 2001 From: Hannah Purcell Date: Wed, 16 Oct 2024 07:47:21 -0400 Subject: [PATCH] tests: Use const for reviewDetourButton --- assets/tests/components/detours/diversionPage.test.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/assets/tests/components/detours/diversionPage.test.tsx b/assets/tests/components/detours/diversionPage.test.tsx index 61197f246..30400247a 100644 --- a/assets/tests/components/detours/diversionPage.test.tsx +++ b/assets/tests/components/detours/diversionPage.test.tsx @@ -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<{ @@ -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()