diff --git a/assets/tests/components/detours/diversionPage.test.tsx b/assets/tests/components/detours/diversionPage.test.tsx index 01a283c10..3169d8f0d 100644 --- a/assets/tests/components/detours/diversionPage.test.tsx +++ b/assets/tests/components/detours/diversionPage.test.tsx @@ -1733,14 +1733,12 @@ describe("DiversionPage", () => { ) // Non-Interactive route shape - expect( - container.querySelectorAll(".c-detour_map--original-route-shape-core") - ).toHaveLength(1) + expect(originalRouteShape.not.interactive.getAll(container)).toHaveLength( + 1 + ) // Interactive route shape - expect( - container.querySelectorAll(".c-detour_map--original-route-shape") - ).toHaveLength(0) + expect(originalRouteShape.interactive.getAll(container)).toHaveLength(0) }) }) }) diff --git a/assets/tests/testHelpers/selectors/components/detours/diversionPage.tsx b/assets/tests/testHelpers/selectors/components/detours/diversionPage.tsx index 90fe97a2b..a21d00a73 100644 --- a/assets/tests/testHelpers/selectors/components/detours/diversionPage.tsx +++ b/assets/tests/testHelpers/selectors/components/detours/diversionPage.tsx @@ -4,6 +4,17 @@ import { byRole } from "testing-library-selector" export const finishDetourButton = byRole("button", { name: "Finish Detour" }) export const originalRouteShape = { + interactive: { + getAll: (container: HTMLElement) => + container.querySelectorAll(".c-detour_map--original-route-shape"), + }, + not: { + interactive: { + getAll: (container: HTMLElement) => + container.querySelectorAll(".c-detour_map--original-route-shape-core"), + }, + }, + get(container: HTMLElement): Element { const maybeShape = container.querySelector( ".c-detour_map--original-route-shape"