From e671a22cf5fd64bfed02949f5f2a3df1fe490754 Mon Sep 17 00:00:00 2001
From: Denis Berezin <denis.berezin@metabase.com>
Date: Fri, 23 Jun 2023 15:37:00 +0300
Subject: [PATCH] Add reproduction test for #25415 (#31805)

[ci skip]
---
 ...415-custom-column-drill-through.cy.spec.js | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 e2e/test/scenarios/visualizations/reproductions/25415-custom-column-drill-through.cy.spec.js

diff --git a/e2e/test/scenarios/visualizations/reproductions/25415-custom-column-drill-through.cy.spec.js b/e2e/test/scenarios/visualizations/reproductions/25415-custom-column-drill-through.cy.spec.js
new file mode 100644
index 00000000000..06a69364fbc
--- /dev/null
+++ b/e2e/test/scenarios/visualizations/reproductions/25415-custom-column-drill-through.cy.spec.js
@@ -0,0 +1,52 @@
+import { popover, restore } from "e2e/support/helpers";
+import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
+
+const { ORDERS, ORDERS_ID } = SAMPLE_DATABASE;
+
+describe.skip("issue 25415", () => {
+  beforeEach(() => {
+    restore();
+    cy.signInAsAdmin();
+  });
+
+  it("should allow to drill-through aggregated query with a custom column on top level (metabase#25415)", () => {
+    cy.createQuestion(
+      {
+        name: "Aggregated query with custom column",
+        display: "line",
+        query: {
+          "source-query": {
+            "source-table": ORDERS_ID,
+            aggregation: [["count"]],
+            breakout: [["field", ORDERS.PRODUCT_ID, null]],
+            limit: 2,
+          },
+          expressions: {
+            "test custom": [
+              "*",
+              [
+                "field",
+                "count",
+                {
+                  "base-type": "type/Integer",
+                },
+              ],
+              2,
+            ],
+          },
+        },
+      },
+      { visitQuestion: true },
+    );
+
+    cy.get(".dc-tooltip-list").get(".dot").first().click({ force: true });
+
+    popover().findByText("See these Orders").click();
+
+    // filter gets applied
+    cy.findByTestId("qb-filters-panel").should("contain", "Product ID is 1");
+
+    // there is a table with data
+    cy.findByTestId("TableInteractive-root").should("exist");
+  });
+});
-- 
GitLab