Skip to content
Snippets Groups Projects
Commit 928cbeb3 authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Extend questionUrlWithParameters tests

parent 0c5179b3
No related branches found
No related tags found
No related merge requests found
...@@ -135,6 +135,26 @@ describe("metabase/meta/Card", () => { ...@@ -135,6 +135,26 @@ describe("metabase/meta/Card", () => {
) )
}); });
}); });
it("should return question URL even if only original_card_id is present", () => {
const cardWithOnlyOriginalCardId = { ...card, id: undefined, original_card_id: card.id };
const url = Card.questionUrlWithParameters(
cardWithOnlyOriginalCardId,
metadata,
parameters,
{ "1": "bar" },
parameterMappings
);
expect(parseUrl(url)).toEqual({
pathname: "/question",
query: {},
card: assocIn(
cardWithOnlyOriginalCardId,
["dataset_query", "query", "filter"],
["AND", ["=", ["field-id", 1], "bar"]]
)
});
});
it("should return question URL with number MBQL filter added", () => { it("should return question URL with number MBQL filter added", () => {
const url = Card.questionUrlWithParameters( const url = Card.questionUrlWithParameters(
card, card,
......
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