Skip to content
Snippets Groups Projects
Unverified Commit 07b98cee authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

E2E repro for "Editing Column description of Model is confusing if it contains...

E2E repro for "Editing Column description of Model is confusing if it contains aggregations" (#45113)

* Fix checks and tests

* Fix checks and tests
parent ec6e1f80
No related branches found
No related tags found
No related merge requests found
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import {
type StructuredQuestionDetails,
createNativeQuestion,
createQuestion,
enterCustomColumnDetails,
......@@ -23,6 +24,7 @@ import {
startNewQuestion,
tableHeaderClick,
undoToast,
visitModel,
visualize,
} from "e2e/support/helpers";
import type { FieldReference } from "metabase-types/api";
......@@ -614,3 +616,55 @@ describe("issue 33427", () => {
.and("contain", "UPDATED_BY");
}
});
describe("issue 39749", () => {
const modelDetails: StructuredQuestionDetails = {
type: "model",
query: {
"source-table": ORDERS_ID,
aggregation: [
["count"],
["sum", ["field", ORDERS.TOTAL, { "base-type": "type/Float" }]],
],
breakout: [
[
"field",
ORDERS.CREATED_AT,
{ "base-type": "type/DateTime", "temporal-unit": "year" },
],
],
},
};
beforeEach(() => {
restore();
cy.signInAsNormalUser();
cy.intercept("PUT", "/api/card/*").as("updateModel");
});
it("should not overwrite the description of one column with the description of another column (metabase#39749)", () => {
createQuestion(modelDetails).then(({ body: card }) => visitModel(card.id));
cy.log("edit metadata");
openQuestionActions();
popover().findByText("Edit metadata").click();
tableHeaderClick("Count");
cy.findByLabelText("Description").type("A");
tableHeaderClick("Sum of Total");
cy.findByLabelText("Description").should("have.text", "").type("B");
tableHeaderClick("Count");
cy.findByLabelText("Description").should("have.text", "A");
tableHeaderClick("Sum of Total");
cy.findByLabelText("Description").should("have.text", "B");
cy.button("Save changes").click();
cy.wait("@updateModel");
cy.log("verify that the description was updated successfully");
openQuestionActions();
popover().findByText("Edit metadata").click();
tableHeaderClick("Count");
cy.findByLabelText("Description").should("have.text", "A");
tableHeaderClick("Sum of Total");
cy.findByLabelText("Description").should("have.text", "B");
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment