From fd802e1db38315dd3dc87a70dbc92031af0d3e83 Mon Sep 17 00:00:00 2001
From: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Date: Mon, 21 Feb 2022 22:24:50 +0100
Subject: [PATCH] Add repro for #15353 (#20672)

---
 ...vot-settings-change-name-values.cy.spec.js | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 frontend/test/metabase/scenarios/visualizations/reproductions/15353-pivot-settings-change-name-values.cy.spec.js

diff --git a/frontend/test/metabase/scenarios/visualizations/reproductions/15353-pivot-settings-change-name-values.cy.spec.js b/frontend/test/metabase/scenarios/visualizations/reproductions/15353-pivot-settings-change-name-values.cy.spec.js
new file mode 100644
index 00000000000..392626bca62
--- /dev/null
+++ b/frontend/test/metabase/scenarios/visualizations/reproductions/15353-pivot-settings-change-name-values.cy.spec.js
@@ -0,0 +1,42 @@
+import { restore, sidebar } from "__support__/e2e/cypress";
+import { SAMPLE_DATABASE } from "__support__/e2e/cypress_sample_database";
+
+const { ORDERS, ORDERS_ID } = SAMPLE_DATABASE;
+
+const questionDetails = {
+  name: "15353",
+  query: {
+    "source-table": ORDERS_ID,
+    aggregation: [["count"]],
+    breakout: [["field", ORDERS.CREATED_AT, { "temporal-unit": "year" }]],
+  },
+  display: "pivot",
+};
+
+describe("issue 15353", () => {
+  beforeEach(() => {
+    cy.intercept("POST", "/api/dataset/pivot").as("pivotDataset");
+
+    restore();
+    cy.signInAsAdmin();
+
+    cy.createQuestion(questionDetails, { visitQuestion: true });
+  });
+
+  it("should be able to change field name used for values (metabase#15353)", () => {
+    cy.findByTestId("viz-settings-button").click();
+    sidebar()
+      .contains("Count")
+      .click();
+
+    cy.findByText("See options…").click();
+
+    cy.findByDisplayValue("Count")
+      .type(" renamed")
+      .blur();
+
+    cy.wait("@pivotDataset");
+
+    cy.get(".Visualization").should("contain", "Count renamed");
+  });
+});
-- 
GitLab