Skip to content

Commit

Permalink
Add wait to meganav and autocomplete spec
Browse files Browse the repository at this point in the history
  • Loading branch information
dpiatek committed Dec 14, 2023
1 parent a9ae563 commit 8a8b050
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions cypress/e2e/core/company_autocomplete/behaviour.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ describe("Company Autocomplete", () => {
});

it("closes the dropdown when clicked outside it", () => {
cy.get("input")
.type("A")
.get("body")
.click()
.get(CONTAINER_SELECTOR)
.should("not.be.visible");
cy.get("input").type("A");
cy.get("body").click();
cy.wait(1000);
cy.get(CONTAINER_SELECTOR).should("not.be.visible");
});

it("closes the dropdown when Esc is pressed", () => {
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/core/meganav/behaviour.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ describe("Opening panels on desktop", () => {
it("opens the correct panel when a control is hovered over and closes it on leave", () => {
cy.get(PLATFORM_PANEL).should("not.be.visible");

cy.get(PLATFORM_PANEL_OPEN_CONTROL).trigger("mouseenter");
cy.get(PLATFORM_PANEL_OPEN_CONTROL).parent().trigger("mouseenter");
cy.get(PLATFORM_PANEL).should("be.visible");

cy.get(PLATFORM_PANEL_OPEN_CONTROL).trigger("mouseleave");
cy.get(PLATFORM_PANEL_OPEN_CONTROL).parent().trigger("mouseleave");
cy.get(PLATFORM_PANEL).should("not.be.visible");
});

Expand Down Expand Up @@ -77,7 +77,7 @@ describe("Opening panels on desktop", () => {
cy.get(SEARCH_PANEL_OPEN_CONTROL).trigger("click");
cy.get(SEARCH_PANEL).should("be.visible");

cy.get(PLATFORM_PANEL_OPEN_CONTROL).trigger("mouseenter");
cy.get(PLATFORM_PANEL_OPEN_CONTROL).parent().trigger("mouseenter");
cy.get(PLATFORM_PANEL).should("not.be.visible");
});

Expand Down

0 comments on commit 8a8b050

Please sign in to comment.