Skip to content
Snippets Groups Projects
Unverified Commit 0620631a authored by Alexander Lesnenko's avatar Alexander Lesnenko Committed by GitHub
Browse files

fix embedded dashboard is not being updated after changing params (#22635)

parent cb69cc44
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,7 @@ export async function fetchDataOrError(dataPromise) {
}
}
export function getDatasetQueryParams(datasetQuery) {
export function getDatasetQueryParams(datasetQuery = {}) {
const { type, query, native, parameters = [] } = datasetQuery;
return { type, query, native, parameters };
}
import {
restore,
popover,
visitDashboard,
saveDashboard,
editDashboard,
setFilter,
} from "__support__/e2e/cypress";
const questionDetails = {
name: "22524 question",
native: {
query: "select * from people where city = {{city}}",
"template-tags": {
city: {
id: "6d077d39-a420-fd14-0b0b-a5eb611ce1e0",
name: "city",
"display-name": "City",
type: "text",
},
},
},
};
describe("issue 22524", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
});
it("update dashboard cards when changing parameters on publicly shared dashboards (metabase#22524)", () => {
cy.createNativeQuestionAndDashboard({ questionDetails }).then(
({ body: { dashboard_id } }) => {
visitDashboard(dashboard_id);
},
);
editDashboard();
setFilter("Text or Category", "Dropdown");
cy.findByText("Select…").click();
popover()
.contains("City")
.click();
saveDashboard();
// Share dashboard
cy.icon("share").click();
cy.findByRole("switch").click();
cy.findByText("Public link")
.parent()
.within(() => {
cy.get("input").then(input => {
cy.visit(input.val());
});
});
// Set parameter value
cy.findByPlaceholderText("Text")
.clear()
.type("Rye{enter}");
// Check results
cy.findByText("2-7900 Cuerno Verde Road");
});
});
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