From c8c034ea7daa7f93b9976b0e18e5e3bdd10c0192 Mon Sep 17 00:00:00 2001 From: Eddie Maldonado Date: Fri, 20 Oct 2023 15:42:27 -0400 Subject: [PATCH] refactor(tests): better query for selected VPP tab Co-authored-by: Kayla Firestack --- assets/tests/components/mapPage.test.tsx | 7 +++---- assets/tests/components/propertiesPanel.test.tsx | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/assets/tests/components/mapPage.test.tsx b/assets/tests/components/mapPage.test.tsx index f5601fcc25..d4aab031fd 100644 --- a/assets/tests/components/mapPage.test.tsx +++ b/assets/tests/components/mapPage.test.tsx @@ -969,10 +969,9 @@ describe("", () => { expect(vehiclePropertiesPanelHeader.get()).toBeInTheDocument() - expect(screen.getByRole("tab", { name: "Run" })).toHaveAttribute( - "aria-selected", - "true" - ) + expect( + screen.getByRole("tab", { name: "Run", selected: true }) + ).toBeVisible() }) describe("", () => { diff --git a/assets/tests/components/propertiesPanel.test.tsx b/assets/tests/components/propertiesPanel.test.tsx index 4745625779..11974ce815 100644 --- a/assets/tests/components/propertiesPanel.test.tsx +++ b/assets/tests/components/propertiesPanel.test.tsx @@ -211,10 +211,9 @@ describe("PropertiesPanel", () => { test("respects initialTab prop", () => { render() - expect(screen.getByRole("tab", { name: "Run" })).toHaveAttribute( - "aria-selected", - "true" - ) + expect( + screen.getByRole("tab", { name: "Run", selected: true }) + ).toBeVisible() }) test("supplied closePanel prop is used", async () => {