Skip to content
Snippets Groups Projects
Unverified Commit 55fed903 authored by Kamil Mielnik's avatar Kamil Mielnik Committed by GitHub
Browse files

Repro #41785 - Using Column picker to remove columns on model breaks question...

Repro #41785 - Using Column picker to remove columns on model breaks question with ERROR: column source.name_2 does not exist Position (#44808)

* Add repro for #41785

* Update comment
parent de786c31
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,14 @@ export function startNewQuestion() {
cy.visit(`/question/notebook#${hash}`);
}
/**
* This is the query generated by clicking "New" and then choosing "Model" and "Use the notebook editor"
*/
export function startNewModel() {
const hash = newCardHash("model");
cy.visit(`/model/query#${hash}`);
}
/**
* This is the query generated by clicking "New" and then choosing "Metric".
*/
......
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import {
createNativeQuestion,
createQuestion,
enterCustomColumnDetails,
entityPickerModal,
entityPickerModalTab,
hovercard,
join,
modal,
openNotebook,
openQuestionActions,
popover,
queryBuilderMain,
restore,
hovercard,
createNativeQuestion,
saveQuestion,
startNewModel,
tableHeaderClick,
openNotebook,
enterCustomColumnDetails,
visualize,
saveQuestion,
} from "e2e/support/helpers";
import type { FieldReference } from "metabase-types/api";
......@@ -389,3 +395,52 @@ describe("issue 39150", { viewportWidth: 1600 }, () => {
.should("have.length", 3);
});
});
describe("issue 41785", () => {
beforeEach(() => {
restore();
cy.signInAsNormalUser();
cy.intercept("POST", "/api/dataset").as("dataset");
});
it("does not break the question when removing column with the same mapping as another column (metabase#41785)", () => {
// it's important to create the model through UI to reproduce this issue
startNewModel();
entityPickerModal().within(() => {
entityPickerModalTab("Tables").click();
cy.findByText("Orders").click();
});
join();
entityPickerModal().within(() => {
entityPickerModalTab("Tables").click();
cy.findByText("Orders").click();
});
popover().findByText("ID").click();
popover().findByText("ID").click();
cy.findByTestId("run-button").click();
cy.wait("@dataset");
cy.button("Save").click();
modal().button("Save").click();
cy.findByTestId("loading-indicator").should("exist");
cy.findByTestId("loading-indicator").should("not.exist");
cy.findByTestId("viz-settings-button").click();
cy.findByTestId("chartsettings-sidebar").within(() => {
cy.findAllByText("Tax").should("have.length", 1);
cy.findAllByText("Orders → Tax").should("have.length", 1);
cy.findByRole("button", { name: "Add or remove columns" }).click();
cy.findAllByText("Tax").should("have.length", 1);
cy.findAllByText("Orders → Tax").should("have.length", 1).click();
});
cy.wait("@dataset");
queryBuilderMain()
.findByText("There was a problem with your question")
.should("not.exist");
});
});
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