Skip to content

Commit

Permalink
fix tests after removal of aria-label
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-tate committed Jul 10, 2024
1 parent 5e3900b commit 7fae525
Showing 1 changed file with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,8 @@ describe("GIVEN a NavItem", () => {
describe("AND it is a parent", () => {
it("should render an expansion button", () => {
cy.mount(<NavigationItem parent={true}>Navigation Item</NavigationItem>);
cy.findByRole("button", { name: "expand" }).should("exist");
cy.findByRole("button", { name: "expand" }).should(
"have.attr",
"aria-expanded",
"false",
);
cy.findByRole("button").should("exist");
cy.findByRole("button").should("have.attr", "aria-expanded", "false");
});

it("should call `onExpand` when the expansion button is clicked", () => {
Expand All @@ -81,7 +77,7 @@ describe("GIVEN a NavItem", () => {
Navigation Item
</NavigationItem>,
);
cy.findByRole("button", { name: "expand" }).realClick();
cy.findByRole("button").realClick();
cy.get("@expandSpy").should("have.been.calledOnce");
});

Expand All @@ -92,11 +88,7 @@ describe("GIVEN a NavItem", () => {
Navigation Item
</NavigationItem>,
);
cy.findByRole("button", { name: "expand" }).should(
"have.attr",
"aria-expanded",
"true",
);
cy.findByRole("button").should("have.attr", "aria-expanded", "true");
});
});
});
Expand Down Expand Up @@ -162,12 +154,8 @@ describe("GIVEN a NavItem", () => {
Navigation Item
</NavigationItem>,
);
cy.findByRole("button", { name: "expand" }).should("exist");
cy.findByRole("button", { name: "expand" }).should(
"have.attr",
"aria-expanded",
"false",
);
cy.findByRole("button").should("exist");
cy.findByRole("button").should("have.attr", "aria-expanded", "false");
cy.findByText("Button Children").should("exist");
});
});
Expand Down

0 comments on commit 7fae525

Please sign in to comment.