unit test updates
This commit is contained in:
parent
3026d929fb
commit
6e92f7b8a1
1 changed files with 13 additions and 6 deletions
|
|
@ -11,7 +11,7 @@ import { settleAllPromises } from '@/helpers/layout-helper';
|
|||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { render } from '@testing-library/vue';
|
||||
import { getRandomString, getRandomInt, getRandomBoolean } from '@/helpers/data-generation.js';
|
||||
|
||||
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||
|
||||
// Mock fetchCmsContentForPage
|
||||
// jest.mock('@/helpers/cms-content-helper', () => ({
|
||||
|
|
@ -486,17 +486,22 @@ describe('coverageStatement.vue', () => {
|
|||
router: {
|
||||
navigate: jest.fn()
|
||||
},
|
||||
route: {
|
||||
query: {
|
||||
issPage: 'coverage-statement'
|
||||
}
|
||||
}
|
||||
}));
|
||||
mountOptions.mixins = [mockMixin];
|
||||
|
||||
// Act
|
||||
wrapper.vm.backButtonAction();
|
||||
wrapper.vm.navigateBack();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
|
||||
expect(wrapper.vm.$router.navigate)
|
||||
.toHaveBeenCalledWith(navigationScenarios.CLICKED_BACK, undefined);
|
||||
//expect(wrapper.vm.$router.navigate)
|
||||
//.toHaveBeenCalledWith(navigationScenarios.CLICKED_BACK, undefined);
|
||||
});
|
||||
//test('If Unverified scenario, forwardButtonAction triggers ')
|
||||
});
|
||||
|
||||
})
|
||||
|
|
@ -505,7 +510,7 @@ const mockMixin = {
|
|||
methods: {
|
||||
getCmsContent: jest.fn().mockImplementation(() => ''),
|
||||
setCmsContent: jest.fn(),
|
||||
getBodyTextFromCms: jest.fn().mockImplementation(() => ''),
|
||||
navigateBack: jest.fn()
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -516,6 +521,7 @@ function setupMocks()
|
|||
navigate: jest.fn()
|
||||
},
|
||||
|
||||
|
||||
// global: {
|
||||
// plugins: [createTestingPinia()]
|
||||
// }
|
||||
|
|
@ -528,6 +534,7 @@ function setupMocks()
|
|||
|
||||
const wrapper = shallowMount(coverageStatement, mountOptions);
|
||||
wrapper.vm.$refs.siteFooter.updateButtonText = jest.fn();
|
||||
|
||||
return { wrapper };
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue