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

Repro for #13801: Dashboard should handle cards with null values (#13811)

The bug was fixed in #13808 .
parent 46a95c35
No related branches found
No related tags found
No related merge requests found
......@@ -7,8 +7,10 @@ import {
} from "__support__/cypress";
describe("scenarios > question > null", () => {
before(restore);
beforeEach(signInAsAdmin);
beforeEach(() => {
restore();
signInAsAdmin();
});
it("should display rows whose value is `null` (metabase#13571)", () => {
withSampleDataset(({ ORDERS }) => {
......@@ -127,6 +129,77 @@ describe("scenarios > question > null", () => {
});
});
it("dashboard should handle cards with null values (metabase#13801)", () => {
cy.log("**-- Create Question 1 --**");
cy.request("POST", "/api/card", {
name: "13801_Q1",
dataset_query: {
database: 1,
native: { query: "SELECT null", "template-tags": {} },
type: "native",
},
display: "scalar",
visualization_settings: {},
}).then(({ body: { id: Q1_ID } }) => {
cy.log("**-- Create Question 2 --**");
cy.request("POST", "/api/card", {
name: "13801_Q2",
dataset_query: {
database: 1,
native: { query: "SELECT 0", "template-tags": {} },
type: "native",
},
display: "scalar",
visualization_settings: {},
}).then(({ body: { id: Q2_ID } }) => {
cy.log("**-- Create Dashboard --**");
cy.request("POST", "/api/dashboard", {
name: "13801D",
}).then(({ body: { id: DASHBOARD_ID } }) => {
cy.log(
`**-- Add both previously created questions to the dashboard--**`,
);
[Q1_ID, Q2_ID].forEach((questionId, index) => {
cy.request("POST", `/api/dashboard/${DASHBOARD_ID}/cards`, {
cardId: questionId,
}).then(({ body: { id: DASHCARD_ID } }) => {
const CARD_SIZE_X = 6;
cy.request("PUT", `/api/dashboard/${DASHBOARD_ID}/cards`, {
cards: [
{
id: DASHCARD_ID,
card_id: questionId,
row: 0,
col: index === 0 ? 0 : CARD_SIZE_X, // making sure the second card doesn't overlap the first one
sizeX: CARD_SIZE_X,
sizeY: 4,
parameter_mappings: [],
},
],
});
});
});
cy.server();
cy.route("POST", "/api/card/*/query").as("cardQuery");
cy.visit(`/dashboard/${DASHBOARD_ID}`);
// wait for the second cardQuery to finish
cy.wait("@cardQuery.2");
cy.log("P0 regression in v0.37.1!");
cy.get(".LoadingSpinner").should("not.exist");
cy.findByText("13801_Q1");
cy.findByText("13801_Q2");
});
});
});
});
describe("aggregations with null values", () => {
beforeEach(() => {
cy.server();
......
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