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

#17139 Repro: Clicking on cancel edit dashboard without any changes removes...

#17139 Repro: Clicking on cancel edit dashboard without any changes removes the dashboard filter (#17140)
parent 7ad2d6fd
Branches
Tags
No related merge requests found
......@@ -13,3 +13,26 @@ export function showDashboardCardActions(index = 0) {
.eq(index)
.realHover();
}
export function editDashboard() {
cy.icon("pencil").click();
}
export function cancelEditingDashboard() {
cy.findByText("Cancel").click();
cy.findByText("You're editing this dashboard.").should("not.exist");
}
export function saveDashboard() {
cy.findByText("Save").click();
cy.findByText("You're editing this dashboard.").should("not.exist");
}
export function checkFilterLabelAndValue(label, value) {
cy.get("fieldset")
.find("legend")
.invoke("text")
.should("eq", label);
cy.get("fieldset").contains(value);
}
import {
restore,
popover,
mockSessionProperty,
filterWidget,
editDashboard,
cancelEditingDashboard,
saveDashboard,
checkFilterLabelAndValue,
} from "__support__/e2e/cypress";
import { setMonthAndYear } from "../../native-filters/helpers/e2e-date-filter-helpers";
describe.skip("issue 17139", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
mockSessionProperty("field-filter-operators-enabled?", true);
cy.visit("/dashboard/1");
editDashboard();
cy.icon("filter").click();
popover().within(() => {
cy.findByText("What do you want to filter?");
cy.findByText("Time").click();
cy.findByText("Month and Year").click();
});
cy.findByText("Select…").click();
popover()
.contains("Created At")
.first()
.click();
saveDashboard();
});
it("should not reset previously defined filters when exiting 'edit' mode without making any changes (metabase#17139)", () => {
filterWidget()
.contains("Month and Year")
.click();
setMonthAndYear({ month: "November", year: "2016" });
cy.url().should("contain", "?month_and_year=2016-11");
checkFilterLabelAndValue("Month and Year", "November, 2016");
editDashboard();
cancelEditingDashboard();
cy.url().should("contain", "?month_and_year=2016-11");
checkFilterLabelAndValue("Month and Year", "November, 2016");
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment