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 d5653c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 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
8 changes: 4 additions & 4 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("mouseover");
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 All @@ -48,7 +48,7 @@ describe("Opening panels on desktop", () => {
cy.get(PLATFORM_PANEL).should("be.visible");
cy.get(COMPANY).should("not.be.visible");

cy.get(COMPANY_OPEN_CONTROL).trigger("mouseenter");
cy.get(COMPANY_OPEN_CONTROL).trigger("mouseover");
cy.get(COMPANY).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("mouseover");
cy.get(PLATFORM_PANEL).should("not.be.visible");
});

Expand Down

0 comments on commit d5653c5

Please sign in to comment.