Adding nav to dupe check page test
This commit is contained in:
parent
a8ddd811e3
commit
44e429a66d
1 changed files with 23 additions and 3 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import welcomePage from '@/layouts/welcome-page/welcome-page.vue';
|
||||
|
||||
// Supporting files
|
||||
// Supporting files
|
||||
import { shallowMount } from '@vue/test-utils';
|
||||
import settleAllPromises from '@/helpers/layout-helper.js';
|
||||
|
|
@ -142,6 +141,28 @@ describe('welcome-page.vue', () => {
|
|||
});
|
||||
|
||||
describe('navigation', () => {
|
||||
test('if duplicates found, navigate to duplicate check page', async () => {
|
||||
// Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
const duplicatesExist = {
|
||||
policyLookupResponse: {},
|
||||
duplicateCheckResponse: [{ test2: 'b'}]
|
||||
};
|
||||
|
||||
settleAllPromises.mockImplementation(() => Promise.resolve(duplicatesExist));
|
||||
|
||||
// Act
|
||||
await wrapper.vm.forwardButtonAction();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(
|
||||
navigationScenarios.CLICKED_FORWARD_WITH_DUPLICATES,
|
||||
undefined,
|
||||
{},
|
||||
{ [routerParams.SAVE_SESSION_SYNCHRONOUS]: true }
|
||||
);
|
||||
});
|
||||
test('if policy and vehicles are found, navigate to policy-vehicle page', async () => {
|
||||
// Arrange
|
||||
const mockvehicles = [
|
||||
|
|
@ -183,8 +204,7 @@ describe('navigation', () => {
|
|||
navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES,
|
||||
undefined,
|
||||
{},
|
||||
{ [routerParams.SAVE_SESSION_SYNCHRONOUS]: true },
|
||||
mockvehicles
|
||||
{ [routerParams.SAVE_SESSION_SYNCHRONOUS]: true }
|
||||
);
|
||||
});
|
||||
test('if policy is found, but no vehicles, navigate to vehicle-selection page', async () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue