From 172c7cc3afae69dad0a47a85227467cc63b995b5 Mon Sep 17 00:00:00 2001 From: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:53:56 +0200 Subject: [PATCH] Repro #44550: Missing display name for the filter with an offset (#44624) --- .../filters-reproductions.cy.spec.js | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js b/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js index 8e0e2b8a091..3aa0ec345a6 100644 --- a/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js +++ b/e2e/test/scenarios/filters-reproductions/filters-reproductions.cy.spec.js @@ -984,3 +984,68 @@ describe("metabase#32985", () => { }); }); }); + +describe.skip("metabase#44550", () => { + beforeEach(() => { + restore(); + cy.signInAsAdmin(); + }); + + it("should display the filter with an offset appropriately in the time-series chrome and in the filter modal (metabase#44550)", () => { + const questionDetails = { + database: SAMPLE_DB_ID, + query: { + "source-table": ORDERS_ID, + aggregation: [["count"]], + breakout: [ + [ + "field", + ORDERS.CREATED_AT, + { + "base-type": "type/DateTime", + "temporal-unit": "month", + }, + ], + ], + filter: [ + "between", + [ + "+", + [ + "field", + ORDERS.CREATED_AT, + { + "base-type": "type/DateTime", + }, + ], + ["interval", 7, "day"], + ], + ["relative-datetime", -30, "day"], + ["relative-datetime", 0, "day"], + ], + }, + type: "query", + }; + + createQuestion(questionDetails, { visitQuestion: true }); + cy.findByTestId("filters-visibility-control").click(); + cy.findByTestId("filter-pill").should( + "have.text", + "Created At is in the previous 30 days, starting 7 days ago", + ); + + cy.log("Repro for the time-series chrome"); + cy.findByTestId("timeseries-filter-button") + .should("not.have.text", "All time") + .and("contain", /previous 30 days/i) + .and("contain", /7 days ago/i); + + cy.log("Repro for the filter modal"); + filter(); + // Not entirely sure how the DOM looks like in this scenario. + // TODO: Update the test if needed. + cy.findByTestId("filter-column-Created At") + .should("contain", /previous 30 days/i) + .and("contain", /7 days ago/i); + }); +}); -- GitLab