Update unit tests
This commit is contained in:
parent
3becdd85c8
commit
d691e709fa
1 changed files with 23 additions and 27 deletions
|
|
@ -43,41 +43,37 @@ function setupMocks(mockApiResponses) {
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('provider-preference.vue', () => {
|
describe('provider-preference.vue', () => {
|
||||||
test('Should navigate to safelite flow when safelite selected', () => {
|
|
||||||
// Arrange
|
|
||||||
const { wrapper } = setupMocks();
|
|
||||||
|
|
||||||
// Act
|
|
||||||
wrapper.vm.selectedProvider = 'SafeliteOption';
|
|
||||||
wrapper.vm.forwardButtonAction();
|
|
||||||
|
|
||||||
// Test
|
|
||||||
expect(wrapper.vm.$router.navigate).toBeCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE, 'provider-preference');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('Should navigate to tpa flow when TPAOption selected and TPA Flow Enabled', () => {
|
|
||||||
// Arrange
|
|
||||||
const { wrapper } = setupMocks();
|
|
||||||
|
|
||||||
// Act
|
|
||||||
wrapper.vm.selectedProvider = 'TPAOption';
|
|
||||||
useMainStore().issConfig.enableTPAFlow = true;
|
|
||||||
wrapper.vm.forwardButtonAction();
|
|
||||||
|
|
||||||
// Test
|
|
||||||
expect(wrapper.vm.$router.navigate).toBeCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_TPA_ENABLED, 'provider-preference');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('Should navigate to tpa disabled route page when TPAOption selected and TPA Flow disabled', () => {
|
test('Should navigate to tpa disabled route page when TPAOption selected and TPA Flow disabled', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks();
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
wrapper.vm.selectedProvider = 'TPAOption';
|
|
||||||
useMainStore().issConfig.enableTPAFlow = false;
|
useMainStore().issConfig.enableTPAFlow = false;
|
||||||
wrapper.vm.forwardButtonAction();
|
wrapper.vm.findAnotherShopClicked();
|
||||||
|
|
||||||
// Test
|
// Test
|
||||||
expect(wrapper.vm.$router.navigate).toBeCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_TPA_DISABLED, 'provider-preference');
|
expect(wrapper.vm.$router.navigate).toBeCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_TPA_DISABLED, 'provider-preference');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Should navigate to safelite flow when navigateWithTPARecalAnswer is called with SafeliteOption', () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = setupMocks();
|
||||||
|
|
||||||
|
// Act
|
||||||
|
wrapper.vm.navigateWithTPARecalAnswer('SafeliteOption');
|
||||||
|
|
||||||
|
// Test
|
||||||
|
expect(wrapper.vm.$router.navigate).toBeCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE, 'provider-preference');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Should navigate to TPA flow when navigateWithTPARecalAnswer is called with TPAOption', () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = setupMocks();
|
||||||
|
|
||||||
|
// Act
|
||||||
|
wrapper.vm.navigateWithTPARecalAnswer('TPAOption');
|
||||||
|
|
||||||
|
// Test
|
||||||
|
expect(wrapper.vm.$router.navigate).toBeCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_TPA_ENABLED, 'provider-preference');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue