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

Repro #33327: Visualization does not recover from an error in native query editor (#45715)

parent ffa54f0f
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,8 @@ import {
createNativeQuestion,
} from "e2e/support/helpers";
import { getRunQueryButton } from "../native-filters/helpers/e2e-sql-filter-helpers";
describe("issue 11727", { tags: "@external" }, () => {
const PG_DB_ID = 2;
......@@ -109,3 +111,46 @@ describe("issue 38083", () => {
});
});
});
describe("issue 33327", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
});
it("should recover from a visualization error (metabase#33327)", () => {
const query = "SELECT 1";
createNativeQuestion(
{ native: { query }, display: "scalar" },
{
visitQuestion: true,
},
);
cy.findByTestId("scalar-value").should("have.text", "1");
cy.findByTestId("visibility-toggler").click();
cy.findByTestId("native-query-editor")
.should("contain", query)
.type("{leftarrow}--");
cy.intercept("POST", "/api/dataset").as("dataset");
cy.findByTestId("native-query-editor").should("contain", "SELECT --1");
getRunQueryButton().click();
cy.wait("@dataset");
cy.findByTestId("visualization-root").icon("warning").should("be.visible");
cy.findByTestId("scalar-value").should("not.exist");
cy.findByTestId("native-query-editor")
.should("contain", "SELECT --1")
.type("{leftarrow}{backspace}{backspace}");
cy.findByTestId("native-query-editor").should("contain", query);
getRunQueryButton().click();
cy.wait("@dataset");
cy.findByTestId("scalar-value").should("have.text", "1");
cy.findByTestId("visualization-root").icon("warning").should("not.exist");
});
});
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