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

#6239 Repro: Not possible to sort by Custom Expression fields (#18029)

parent d5377a5a
No related branches found
No related tags found
No related merge requests found
import { restore, popover, openOrdersTable } from "__support__/e2e/cypress";
describe.skip("issue 6239", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
openOrdersTable({ mode: "notebook" });
cy.findByText("Summarize").click();
cy.findByText("Custom Expression").click();
cy.get("[contenteditable='true']")
.type("CountIf([Total] > 0)")
.blur();
cy.findByPlaceholderText("Name (required)").type("CE");
cy.button("Done").click();
cy.findByText("Pick a column to group by").click();
popover()
.contains("Created At")
.first()
.click();
});
it("should be possible to sort by using custom expression (metabase#6239)", () => {
cy.findByText("Sort").click();
popover()
.contains(/^CE$/)
.click();
cy.button("Visualize").click();
// Line chart renders initially. Switch to the table view.
cy.icon("table2").click();
cy.get(".cellData")
.eq(1)
.should("contain", "CE")
.and("have.descendants", ".Icon-chevronup");
cy.get(".cellData")
.eq(3)
.invoke("text")
.should("eq", "1");
// Go back to the notebook editor
cy.icon("notebook").click();
// Sort descending this time
cy.icon("arrow_up").click();
cy.icon("arrow_up").should("not.exist");
cy.icon("arrow_down");
cy.button("Visualize").click();
cy.get(".cellData")
.eq(1)
.should("contain", "CE")
.and("have.descendants", ".Icon-chevrondown");
cy.get(".cellData")
.eq(3)
.invoke("text")
.should("eq", "584");
});
});
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