From 2186c69f9500b8ceb646f9e6486a62fc7d80abe4 Mon Sep 17 00:00:00 2001 From: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com> Date: Sun, 8 Aug 2021 02:57:34 +0200 Subject: [PATCH] #17211 Repro: No matching dashboard filter found when it clearly has been found (#17364) --- .../reproductions/17211.cy.spec.js | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 frontend/test/metabase/scenarios/dashboard-filters/reproductions/17211.cy.spec.js diff --git a/frontend/test/metabase/scenarios/dashboard-filters/reproductions/17211.cy.spec.js b/frontend/test/metabase/scenarios/dashboard-filters/reproductions/17211.cy.spec.js new file mode 100644 index 00000000000..25ec40e3f11 --- /dev/null +++ b/frontend/test/metabase/scenarios/dashboard-filters/reproductions/17211.cy.spec.js @@ -0,0 +1,74 @@ +import { restore, filterWidget } from "__support__/e2e/cypress"; + +import { SAMPLE_DATASET } from "__support__/e2e/cypress_sample_dataset"; + +const { ORDERS, ORDERS_ID, PEOPLE } = SAMPLE_DATASET; + +const questionDetails = { + query: { + "source-table": ORDERS_ID, + }, +}; + +const filter = { + name: "Location", + slug: "location", + id: "96917420", + type: "string/=", + sectionId: "location", +}; + +describe.skip("issue 17211", () => { + beforeEach(() => { + restore(); + cy.signInAsAdmin(); + + cy.createQuestionAndDashboard({ questionDetails }).then( + ({ body: { id, card_id, dashboard_id } }) => { + cy.addFilterToDashboard({ filter, dashboard_id }); + + cy.request("PUT", `/api/dashboard/${dashboard_id}/cards`, { + cards: [ + { + id, + card_id, + row: 0, + col: 0, + sizeX: 8, + sizeY: 6, + series: [], + visualization_settings: {}, + parameter_mappings: [ + { + parameter_id: filter.id, + card_id, + target: [ + "dimension", + [ + "field", + PEOPLE.CITY, + { + "source-field": ORDERS.USER_ID, + }, + ], + ], + }, + ], + }, + ], + }); + + cy.visit(`/dashboard/${dashboard_id}`); + }, + ); + }); + + it("should not falsely alert that no matching dashboard filter has been found (metabase#17211)", () => { + filterWidget().click(); + + cy.findByPlaceholderText("Search by City").type("abb"); + cy.findByText("Abbeville").click(); + + cy.contains("No matching City found").should("not.exist"); + }); +}); -- GitLab