Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

e2e: add e2e reproduction (#66351)

Egor Grushine3a6420b788f
diff --git a/e2e/test/scenarios/question/detail-visualization-custom-column.cy.spec.ts b/e2e/test/scenarios/question/detail-visualization-custom-column.cy.spec.ts
new file mode 100644
index 00000000000..3d7e457c4fa
--- /dev/null
+++ b/e2e/test/scenarios/question/detail-visualization-custom-column.cy.spec.ts
@@ -0,0 +1,42 @@
+import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
+
+const { H } = cy;
+const { ORDERS_ID } = SAMPLE_DATABASE;
+
+describe("scenarios > question > detail visualization + custom column preview", () => {
+ beforeEach(() => {
+ H.restore();
+ cy.signInAsAdmin();
+ });
+
+ it("should render a newly added custom column when previewing Detail visualization (metabase#63181)", () => {
+ const CUSTOM_COLUMN_NAME = "Tax custom column";
+
+ // Create a simple question and set visualization to "Detail" (Object Detail)
+ H.createQuestion(
+ {
+ name: "Detail viz with custom column (preview)",
+ query: { "source-table": ORDERS_ID },
+ display: "object",
+ },
+ { visitQuestion: true },
+ );
+
+ // Go to notebook editor and add a simple custom column
+ H.openNotebook();
+ H.addCustomColumn();
+ H.enterCustomColumnDetails({ formula: "[Tax]", name: CUSTOM_COLUMN_NAME });
+ cy.button("Done").click();
+
+ // Click Visualize without saving the question
+ cy.button("Visualize").click();
+
+ // Ensure the Detail visualization renders
+ cy.findByTestId("object-detail").should("be.visible");
+
+ // The newly added custom column should be rendered in the Detail view preview
+ cy.findByTestId("object-detail")
+ .findByText(CUSTOM_COLUMN_NAME)
+ .should("exist");
+ });
+});