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

#13597 Repro: Map pins not updating dashboard filter on click [ci skip] (#13768)

parent 4dc351a0
No related branches found
No related tags found
No related merge requests found
......@@ -184,6 +184,89 @@ describe("scenarios > dashboard", () => {
cy.findByText("You're editing this dashboard.").should("not.exist");
});
it.skip("should update a dashboard filter by clicking on a map pin (metabase#13597)", () => {
// 1. create a question based on repro steps in #13597
withSampleDataset(({ PEOPLE }) => {
cy.request("POST", "/api/card", {
name: "13597",
dataset_query: {
database: 1,
query: {
"source-table": 3,
limit: 2,
},
type: "query",
},
display: "map",
visualization_settings: {},
}).then(({ body: { id: questionId } }) => {
// 2. create a dashboard
cy.request("POST", "/api/dashboard", {
name: "13597D",
}).then(({ body: { id: dashboardId } }) => {
// add filter (ID) to the dashboard
cy.request("PUT", `/api/dashboard/${dashboardId}`, {
parameters: [
{
id: "92eb69ea",
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: 10,
sizeY: 8,
parameter_mappings: [
{
parameter_id: "92eb69ea",
card_id: questionId,
target: ["dimension", ["field-id", PEOPLE.ID]],
},
],
visualization_settings: {
// set click behavior to update filter (ID)
click_behavior: {
type: "crossfilter",
parameterMapping: {
id: "92eb69ea",
source: { id: "ID", name: "ID", type: "column" },
target: {
id: "92eb69ea",
type: "parameter",
},
},
},
},
},
],
});
});
cy.visit(`/dashboard/${dashboardId}`);
cy.get(".leaflet-marker-icon") // pin icon
.eq(0)
.click({ force: true });
cy.url().should("include", `/dashboard/${dashboardId}?id=1`);
cy.contains("Hudson Borer - 1");
});
});
});
});
describe("revisions screen", () => {
it("should open and close", () => {
cy.visit("/dashboard/1");
......
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