Skip to content
Snippets Groups Projects
Unverified Commit 54b141c7 authored by Anton Kulyk's avatar Anton Kulyk Committed by GitHub
Browse files

Fix maps visualization crashing on x-rays (#48742)

* Add default value for `hiddenIndices`

* Add e2e test
parent 880119e7
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ import {
assertEChartsTooltip,
cartesianChartCircle,
chartPathWithFillColor,
dashboardGrid,
getDashboardCards,
main,
popover,
......@@ -364,6 +365,46 @@ describe("scenarios > x-rays", { tags: "@slow" }, () => {
);
cy.findByTestId("dashboard-grid").should("have.css", "max-width", "1048px");
});
it("should render all cards without errors (metabase#48519)", () => {
cy.intercept("POST", "/api/dataset").as("dataset");
cy.visit(`/auto/dashboard/table/${ORDERS_ID}`);
// There're 8 questions on the Orders x-ray dashboard
cy.wait(Array(8).fill("@dataset"), { timeout: 60 * 1000 });
getDashcardByTitle("Total transactions")
.findByText("18,760")
.should("exist");
getDashcardByTitle("Transactions in the last 30 days")
.findByText("504")
.should("exist");
getDashcardByTitle("Average quantity per month").within(() => {
cy.findByText("Average of Quantity").should("exist");
cy.findByText("Created At").should("exist");
});
getDashcardByTitle("Sales per source").within(() => {
cy.findByText("Organic").should("exist");
cy.findByText("Affiliate").should("exist");
cy.findByText("Count").should("exist");
cy.findByText("Created At").should("exist");
});
getDashcardByTitle("Sales per product").within(() => {
cy.findByText("Product → Title").should("exist");
cy.findByText("Aerodynamic Bronze Hat").should("exist");
});
getDashcardByTitle("Sales for each product category").within(() => {
cy.findByText("Product → Category").should("exist");
cy.findByText("Doohickey").should("exist");
cy.findByText("Count").should("exist");
});
getDashcardByTitle("Sales per state")
.findAllByTestId("choropleth-feature")
.should("have.length", 50); // 50 states
getDashcardByTitle("Sales by coordinates")
.findByText("Leaflet")
.should("exist");
});
});
function waitForSatisfyingResponse(
......@@ -383,3 +424,7 @@ function waitForSatisfyingResponse(
}
});
}
function getDashcardByTitle(title) {
return dashboardGrid().findByText(title).closest("[data-testid='dashcard']");
}
......@@ -13,7 +13,7 @@ export default class LegendHorizontal extends Component {
className,
titles,
colors,
hiddenIndices,
hiddenIndices = [],
hovered,
onHoverChange,
onToggleSeriesVisibility,
......
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