Skip to content

Commit

Permalink
refactor(tests): better query for selected VPP tab
Browse files Browse the repository at this point in the history
Co-authored-by: Kayla Firestack <[email protected]>
  • Loading branch information
lemald and firestack committed Oct 20, 2023
1 parent 05fabac commit c8c034e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions assets/tests/components/mapPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -969,10 +969,9 @@ describe("<MapPage />", () => {

expect(vehiclePropertiesPanelHeader.get()).toBeInTheDocument()

expect(screen.getByRole("tab", { name: "Run" })).toHaveAttribute(
"aria-selected",
"true"
)
expect(
screen.getByRole("tab", { name: "Run", selected: true })
).toBeVisible()
})

describe("<VehiclePropertiesCard />", () => {
Expand Down
7 changes: 3 additions & 4 deletions assets/tests/components/propertiesPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,9 @@ describe("PropertiesPanel", () => {
test("respects initialTab prop", () => {
render(<PropertiesPanelWrapper vehicleOrGhost={vehicle} initialTab="run" />)

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 () => {
Expand Down

0 comments on commit c8c034e

Please sign in to comment.