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

#17060 Repro: Duplication of the displayed table columns (#17361)

parent 2186c69f
No related branches found
No related tags found
No related merge requests found
import { restore, openNativeEditor } from "__support__/e2e/cypress";
import { runQuery } from "../../native-filters/helpers/e2e-sql-filter-helpers";
const ORIGINAL_QUERY = `select ID as "num", CATEGORY as "text" from PRODUCTS limit 1`;
const SECTION = "select ";
const SELECTED_TEXT = "ID";
const moveCursorToBeginning = "{selectall}{leftarrow}";
const highlightSelectedText = "{shift}{rightarrow}".repeat(
SELECTED_TEXT.length,
);
const moveCursorAfterSection = "{rightarrow}".repeat(SECTION.length);
describe("issue 17060", () => {
beforeEach(() => {
cy.intercept("POST", "/api/dataset").as("dataset");
restore();
cy.signInAsAdmin();
openNativeEditor().type(ORIGINAL_QUERY);
runQuery();
cy.findByTestId("viz-settings-button").click();
cy.findByTestId("sidebar-left").within(() => {
rearrangeColumns();
});
});
it("should not render duplicated columns (metabase#17060)", () => {
cy.get("@editor").type(
moveCursorToBeginning +
moveCursorAfterSection +
highlightSelectedText +
"RATING",
{ delay: 50 },
);
runQuery();
cy.get(".Visualization").within(() => {
cy.findByText("num");
});
});
});
function rearrangeColumns() {
cy.get(".cursor-grab")
.first()
.trigger("mousedown", 0, 0, { force: true })
.trigger("mousemove", 5, 5, { force: true })
.trigger("mousemove", 0, 100, { force: true })
.trigger("mouseup", 0, 100, { force: true });
}
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