Skip to content
Snippets Groups Projects
Unverified Commit 3c54987f authored by Uladzimir Havenchyk's avatar Uladzimir Havenchyk Committed by GitHub
Browse files

Add tests verifying that #18817 has been fixed (#35744)

parent 4d929086
No related branches found
No related tags found
No related merge requests found
import { restore, visitQuestionAdhoc } from "e2e/support/helpers";
import { restore, rightSidebar, visitQuestionAdhoc } from "e2e/support/helpers";
import { SAMPLE_DB_ID } from "e2e/support/cypress_data";
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
const { PEOPLE_ID, PEOPLE } = SAMPLE_DATABASE;
const questionDetails = {
display: "table",
......@@ -18,7 +21,7 @@ const questionDetails = {
},
};
describe("issue 18976", () => {
describe("issue 18976, 18817", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
......@@ -30,4 +33,34 @@ describe("issue 18976", () => {
// eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage
cy.findByText("Showing 1 row");
});
it("should not keep orphan columns rendered after switching from pivot to regular table (metabase#18817)", () => {
cy.createQuestion(
{
query: {
"source-table": PEOPLE_ID,
aggregation: [["count"]],
breakout: [
["field", PEOPLE.NAME],
["field", PEOPLE.SOURCE],
],
limit: 5,
},
database: SAMPLE_DB_ID,
display: "table",
},
{ visitQuestion: true },
);
cy.findByTestId("qb-header").button("Summarize").click();
rightSidebar()
.findByLabelText("Source")
.findByRole("button", { name: "Remove dimension" })
.click();
cy.findAllByTestId("header-cell")
.should("have.length", 2)
.and("contain", "Name")
.and("contain", "Count");
});
});
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