From fc1163f373a76b22cde4ead1553c11da6904c8fd Mon Sep 17 00:00:00 2001 From: krisantrobus <55083528+krisantrobus@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:24:02 -0500 Subject: [PATCH] fix(cypress): fix issue with cypress and vercel previews (#4088) --- cypress/integration/sidebar-navigation/index.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cypress/integration/sidebar-navigation/index.spec.ts b/cypress/integration/sidebar-navigation/index.spec.ts index f8540cd864..55f3d365d9 100644 --- a/cypress/integration/sidebar-navigation/index.spec.ts +++ b/cypress/integration/sidebar-navigation/index.spec.ts @@ -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"); }); });