diff --git a/frontend/test/__support__/e2e/commands/api/composite/createQuestionAndDashboard.js b/frontend/test/__support__/e2e/commands/api/composite/createQuestionAndDashboard.js index 9575273dee2022fdf08c3f57ae587a2af6a4a1af..78dfe145e0c9af79fdd05ea6140d618a74ee0cc6 100644 --- a/frontend/test/__support__/e2e/commands/api/composite/createQuestionAndDashboard.js +++ b/frontend/test/__support__/e2e/commands/api/composite/createQuestionAndDashboard.js @@ -6,6 +6,9 @@ Cypress.Commands.add( ({ body: { id: dashboardId } }) => { cy.request("POST", `/api/dashboard/${dashboardId}/cards`, { cardId: questionId, + // Add sane defaults for the dashboard card size + sizeX: 8, + sizeY: 6, }); }, ); diff --git a/frontend/test/metabase/scenarios/dashboard-filters/reproductions/17212.cy.spec.js b/frontend/test/metabase/scenarios/dashboard-filters/reproductions/17212.cy.spec.js new file mode 100644 index 0000000000000000000000000000000000000000..89f764114966e7894f0a802345e04efd7363cf64 --- /dev/null +++ b/frontend/test/metabase/scenarios/dashboard-filters/reproductions/17212.cy.spec.js @@ -0,0 +1,53 @@ +import { + restore, + editDashboard, + setFilter, + popover, +} from "__support__/e2e/cypress"; + +import { SAMPLE_DATASET } from "__support__/e2e/cypress_sample_dataset"; + +const { PRODUCTS_ID } = SAMPLE_DATASET; + +const baseQuestion = { + query: { "source-table": PRODUCTS_ID }, +}; + +describe.skip("issue 17212", () => { + beforeEach(() => { + restore(); + cy.signInAsAdmin(); + + cy.createQuestion(baseQuestion).then(({ body: { id: baseQuestionId } }) => { + const questionDetails = { + query: { "source-table": `card__${baseQuestionId}` }, + }; + + cy.createQuestionAndDashboard({ questionDetails }).then( + ({ body: { card_id, dashboard_id } }) => { + cy.intercept("POST", `/api/card/${card_id}/query`).as("cardQuery"); + + cy.visit(`/dashboard/${dashboard_id}`); + + cy.wait("@cardQuery"); + }, + ); + }); + }); + + it("should be able to add ID dashboard filter to the nested question (metabase#17212)", () => { + editDashboard(); + + setFilter("ID"); + + cy.findByText("No valid fields").should("not.exist"); + + cy.findByText("Column to filter on") + .next("a") + .click(); + + popover() + .contains("ID") + .click(); + }); +});