23 lines
873 B
JavaScript
23 lines
873 B
JavaScript
import router from "@/router"
|
|
|
|
|
|
describe("router getNavigationMap", () => {
|
|
test("should return correct destinationUrl for welcome-page and CLICKED_TEST scenario", function() {
|
|
const currentRoute = { query: {issPage: "welcome-page"}};
|
|
expect(router.getNavigationMap("CLICKED_TEST", currentRoute)).toEqual({"destinationUrl": "https://www.google.com", "scenario": "CLICKED_TEST"});
|
|
});
|
|
|
|
test("should return undefined with bad issPage", function() {
|
|
const currentRoute = { query: {issPage: "badRoute"}};
|
|
expect(router.getNavigationMap("CLICKED_TEST", currentRoute)).toBeUndefined;
|
|
});
|
|
|
|
test("should return undefined with missing scenario", function() {
|
|
const currentRoute = { query: {issPage: "welcome-page"}};
|
|
expect(router.getNavigationMap("MISSING_SCENARIO", currentRoute)).toBeUndefined;
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|