Skip to content
Snippets Groups Projects
Unverified Commit 731711ed authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Repro #22517: Adding/removing columns on an existing model will drop all...

Repro #22517: Adding/removing columns on an existing model will drop all configured metadata (#23071)
parent d07084d6
No related branches found
No related tags found
No related merge requests found
import { restore } from "__support__/e2e/cypress";
import { openDetailsSidebar } from "../helpers/e2e-models-helpers";
describe.skip("issue 22517", () => {
beforeEach(() => {
cy.intercept("POST", "/api/card/*/query").as("cardQuery");
cy.intercept("PUT", "/api/card/*").as("updateMetadata");
restore();
cy.signInAsAdmin();
cy.createNativeQuestion(
{
name: "22517",
native: { query: `select * from orders` },
dataset: true,
},
{ visitQuestion: true },
);
openDetailsSidebar();
cy.findByText("Customize metadata").click();
cy.wait(["@cardQuery", "@cardQuery"]);
renameColumn("ID", "Foo");
cy.button("Save changes").click();
cy.wait("@updateMetadata");
});
it("adding or removging a column should not drop previously edited metadata (metabase#22517)", () => {
openDetailsSidebar();
cy.findByText("Edit query definition").click();
cy.wait(["@cardQuery", "@cardQuery"]);
// Make sure previous metadata changes are reflected in the UI
cy.findByText("Foo");
// This will edit the original query and add the `SIZE` column
// Updated query: `select *, case when quantity > 4 then 'large' else 'small' end size from orders`
cy.get(".ace_content").type(
"{leftarrow}".repeat(" from orders".length) +
", case when quantity > 4 then 'large' else 'small' end size ",
);
cy.get(".NativeQueryEditor .Icon-play").click();
cy.wait("@dataset");
cy.findByText("Foo");
});
});
function renameColumn(column, newName) {
cy.findByDisplayValue(column)
.clear()
.type(newName)
.blur();
}
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