Skip to content
Snippets Groups Projects
Unverified Commit f9a8b663 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Fix flaky reproduction for #15891 (#33154)

parent 6585f0c1
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,6 @@ import { ...@@ -2,7 +2,6 @@ import {
enterCustomColumnDetails, enterCustomColumnDetails,
restore, restore,
openProductsTable, openProductsTable,
popover,
} from "e2e/support/helpers"; } from "e2e/support/helpers";
describe("scenarios > question > custom column > help text", () => { describe("scenarios > question > custom column > help text", () => {
...@@ -34,24 +33,26 @@ describe("scenarios > question > custom column > help text", () => { ...@@ -34,24 +33,26 @@ describe("scenarios > question > custom column > help text", () => {
}); });
it("should not appear when formula field is not in focus (metabase#15891)", () => { it("should not appear when formula field is not in focus (metabase#15891)", () => {
enterCustomColumnDetails({ formula: "rou{enter}1.5" }); enterCustomColumnDetails({ formula: "rou{enter}1.5){leftArrow}" });
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage cy.findByTestId("expression-helper-popover").findByText(
cy.findByText("round([Temperature])"); "round([Temperature])",
);
// Click outside of formula field instead of blur cy.log("Blur event should remove the expression helper popover");
popover().first().click(); cy.get("@formula").blur();
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage cy.findByTestId("expression-helper-popover").should("not.exist");
cy.findByText("round([Temperature])").should("not.exist");
// Should also work with escape key
cy.get("@formula").focus(); cy.get("@formula").focus();
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage cy.findByTestId("expression-helper-popover").findByText(
cy.findByText("round([Temperature])"); "round([Temperature])",
);
cy.log(
"Pressing `escape` key should also remove the expression helper popover",
);
cy.get("@formula").type("{esc}"); cy.get("@formula").type("{esc}");
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage cy.findByTestId("expression-helper-popover").should("not.exist");
cy.findByText("round([Temperature])").should("not.exist");
}); });
it("should not disappear when clicked on (metabase#17548)", () => { it("should not disappear when clicked on (metabase#17548)", () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment