Skip to content

Commit

Permalink
fix(cypress): fix issue with cypress and vercel previews (#4088)
Browse files Browse the repository at this point in the history
  • Loading branch information
krisantrobus authored Sep 26, 2024
1 parent 607d233 commit fc1163f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cypress/integration/sidebar-navigation/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ describe("Sidebar navigation", () => {
const contentSelector = `${BASE}-content-${disclosureName}`;

it(`should open the the "${disclosureName}" sidebar disclosure`, () => {
cy.get(`[data-cy="${buttonSelector}"]`).click().should("have.attr", "aria-expanded", "true");
// creates an alias for the content
cy.get(`[data-cy="${contentSelector}"]`).as("currentContent");
cy.get("@currentContent").should("have.css", "display", "none");
cy.get("@currentContent").should("have.attr", "hidden", "hidden");

cy.get("@currentContent").scrollIntoView().should("be.visible");
cy.get(`[data-cy="${buttonSelector}"]`).click().should("have.attr", "aria-expanded", "true");
cy.get("@currentContent").scrollIntoView().should("have.css", "display", "block");
});
});

Expand Down

0 comments on commit fc1163f

Please sign in to comment.