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

#17512 Repro: Custom Expression case is using wrong field reference when nested query (#17576)

parent d012c89b
No related branches found
No related tags found
No related merge requests found
import { restore, openOrdersTable, popover } from "__support__/e2e/cypress";
describe.skip("issue 17512", () => {
beforeEach(() => {
cy.intercept("POST", "/api/dataset").as("dataset");
restore();
cy.signInAsAdmin();
});
it("custom expression should work with `case` in nested queries (metabase#17512)", () => {
openOrdersTable({ mode: "notebook" });
addSummarizeCustomExpression(
"Distinct(case([Discount] > 0, [Subtotal], [Total]))",
"CE",
);
cy.findByText("Pick a column to group by").click();
cy.findByText("Created At").click();
addCustomColumn("1 + 1", "CC");
cy.button("Visualize").click();
cy.wait("@dataset").then(({ response }) => {
expect(response.body.error).not.to.exist;
});
cy.findByText("CE");
cy.findByText("CC");
});
});
function addSummarizeCustomExpression(formula, name) {
cy.findByText("Summarize").click();
popover()
.contains("Custom Expression")
.click();
popover().within(() => {
cy.get("[contenteditable='true']")
.type(formula)
.blur();
cy.findByPlaceholderText("Name (required)").type(name);
cy.button("Done").click();
});
}
function addCustomColumn(formula, name) {
cy.findByText("Custom column").click();
popover().within(() => {
cy.get("[contenteditable='true']")
.type(formula)
.blur();
cy.findByPlaceholderText("Something nice and descriptive").type(name);
cy.button("Done").click();
});
}
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