28 lines
No EOL
887 B
JavaScript
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);
|
|
|
|
});
|
|
|
|
}); |