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

Repro for #13626: Pie chart shows spinner for `0` or `null` [ci skip] (#13673)

* Add repro for #13626 [ci skip]

Note: Once this issue is fixed, add a positive assertion to the Cypress test.
parent 5ab5fd87
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,87 @@ describe("scenarios > question > null", () => {
});
});
it.skip("(metabase#13626)", () => {
// Preparation for the test: "Arrange and Act phase" - see repro steps in #13626
withSampleDataset(({ ORDERS }) => {
// 1. create a question
cy.request("POST", "/api/card", {
name: "13626",
dataset_query: {
database: 1,
query: {
"source-table": 2,
aggregation: [["sum", ["expression", "NewDiscount"]]],
breakout: [["field-id", ORDERS.ID]],
expressions: {
NewDiscount: [
"case",
[[["=", ["field-id", ORDERS.ID], 2], 0]],
{ default: ["field-id", ORDERS.DISCOUNT] },
],
},
filter: ["=", ["field-id", ORDERS.ID], 1, 2, 3],
},
type: "query",
},
display: "pie",
visualization_settings: {},
}).then(({ body: { id: questionId } }) => {
// 2. create a dashboard
cy.request("POST", "/api/dashboard", {
name: "13626D",
}).then(({ body: { id: dashboardId } }) => {
// add filter (ID) to the dashboard
cy.request("PUT", `/api/dashboard/${dashboardId}`, {
parameters: [
{
id: "1f97c149",
name: "ID",
slug: "id",
type: "id",
},
],
});
// add previously created question to the dashboard
cy.request("POST", `/api/dashboard/${dashboardId}/cards`, {
cardId: questionId,
}).then(({ body: { id: dashCardId } }) => {
// connect filter to that question
cy.request("PUT", `/api/dashboard/${dashboardId}/cards`, {
cards: [
{
id: dashCardId,
card_id: questionId,
row: 0,
col: 0,
sizeX: 8,
sizeY: 6,
parameter_mappings: [
{
parameter_id: "1f97c149",
card_id: questionId,
target: ["dimension", ["field-id", ORDERS.ID]],
},
],
},
],
});
});
// NOTE: The actual "Assertion" phase begins here
cy.visit(`/dashboard/${dashboardId}?id=1`);
cy.findByText("13626D");
cy.log("**Reported failing in v0.37.0.2**");
// TODO: Once the issue is fixed, add a positive asssertion here
cy.get(".DashCard").within(() => {
cy.get(".LoadingSpinner").should("not.exist");
});
});
});
});
});
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