From 31762a4dd025b96fbb7609c524a78ff5f7d2d5dc Mon Sep 17 00:00:00 2001 From: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com> Date: Mon, 16 Nov 2020 15:38:56 +0100 Subject: [PATCH] Repro for #12839: Can't use filter based on CE from aggregated results (#13784) (Filtering Custom Expression from aggregated result fails with column not found) --- .../scenarios/question/filter.cy.spec.js | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/frontend/test/metabase/scenarios/question/filter.cy.spec.js b/frontend/test/metabase/scenarios/question/filter.cy.spec.js index 1a89b2331f1..52e7c7f4722 100644 --- a/frontend/test/metabase/scenarios/question/filter.cy.spec.js +++ b/frontend/test/metabase/scenarios/question/filter.cy.spec.js @@ -191,4 +191,44 @@ describe("scenarios > question > filter", () => { cy.findAllByText("Fantastic Wool Shirt").should("not.exist"); }); }); + + it.skip("should filter using Custom Expression from aggregated results (metabase#12839)", () => { + const CE_NAME = "Simple Math"; + + withSampleDataset(({ PRODUCTS }) => { + cy.request("POST", "/api/card", { + name: "12839", + dataset_query: { + database: 1, + query: { + filter: [">", ["field-literal", CE_NAME, "type/Float"], 0], + "source-query": { + aggregation: [ + [ + "aggregation-options", + ["+", 1, 1], + { "display-name": CE_NAME }, + ], + ], + breakout: [["field-id", PRODUCTS.CATEGORY]], + "source-table": 1, + }, + }, + type: "query", + }, + display: "table", + visualization_settings: {}, + }).then(({ body: { id: questionId } }) => { + cy.server(); + cy.route("POST", `/api/card/${questionId}/query`).as("cardQuery"); + + cy.visit(`/question/${questionId}`); + cy.wait("@cardQuery"); + + cy.log("**Reported failing on v0.35.4**"); + cy.log(`Error message: **Column 'source.${CE_NAME}' not found;**`); + cy.findAllByText("Gizmo"); + }); + }); + }); }); -- GitLab