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

Repro #27768: CC dashboard filter appears disconnected (#27791)

parent 1e97b53c
No related merge requests found
import {
restore,
popover,
visitDashboard,
editDashboard,
saveDashboard,
filterWidget,
} from "__support__/e2e/helpers";
import { SAMPLE_DATABASE } from "__support__/e2e/cypress_sample_database";
const { PRODUCTS_ID, PRODUCTS } = SAMPLE_DATABASE;
const questionDetails = {
name: "27768",
query: {
"source-table": PRODUCTS_ID,
limit: 5,
expressions: { CCategory: ["field", PRODUCTS.CATEGORY, null] },
},
};
const filter = {
name: "Cat",
slug: "cat",
id: "b3b436dd",
type: "string/=",
sectionId: "string",
};
describe.skip("issue 27768", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
cy.createQuestionAndDashboard({ questionDetails }).then(
({ body: { dashboard_id } }) => {
cy.request("PUT", `/api/dashboard/${dashboard_id}`, {
parameters: [filter],
});
visitDashboard(dashboard_id, { queryParams: { cat: "Gizmo" } });
},
);
});
it("filter connected to custom column should visually indicate it is connected (metabase#27768)", () => {
// We need to manually connect the filter to the custom column using the UI,
// but when we fix the issue, it should be safe to do this via API
editDashboard();
getFilterOptions(filter.name);
cy.findByText("Select…").click();
popover().contains("CCategory").click();
saveDashboard();
filterWidget().click();
cy.findByPlaceholderText("Enter some text").type("Gizmo").blur();
cy.button("Add filter").click();
cy.findAllByText("Doohickey").should("not.exist");
// Make sure the filter is still connected to the custom column
editDashboard();
getFilterOptions(filter.name);
cy.findByText("Select…").should("not.exist");
cy.findByText("Column to filter on").parent().contains("Product.CCategory");
});
});
function getFilterOptions(filterName) {
cy.findByText(filterName).find(".Icon-gear").click();
}
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