DigitalConsumer.ISS/src/router/router.spec.js
Kulbhushan Kaushik 3b8ec45c79 commit
2023-01-20 13:30:07 -05:00

28 lines
No EOL
887 B
JavaScript

import router from "@/router/";
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
import { issPageValues } from "@/router/router-constants/issPage-values";
import { createApp } from 'vue';
import { createPinia } from "pinia";
import App from '@/App.vue';
describe("Router", () => {
beforeAll(() => {
const vueApp = createApp(App);
const pinia = createPinia();
vueApp.use(pinia);
});
it("Should push next view when navigating locally", () => {
let scenario = navigationScenarios.CLICKED_FORWARD_WELCOME_PAGE;
let currentRoute = { query: { issPage: issPageValues.WELCOME_PAGE }};
router.push = jest.fn();
router.navigate(scenario, currentRoute);
expect(router.push.mock.calls[0][0].query.issPage).toBe(issPageValues.POLICY_HOLDER_DETAILS);
});
});