Updating tests
git push
This commit is contained in:
parent
deacd58008
commit
4b40e1ca6e
1 changed files with 44 additions and 4 deletions
|
|
@ -248,13 +248,25 @@ describe('contactDetails.vue', () => {
|
|||
expect(wrapper.vm.$router.navigateWithSpinner)
|
||||
.toHaveBeenCalledWith(navigationScenarios.CLICKED_BACK, undefined);
|
||||
});
|
||||
test('Forward button clicked triggers navigation', () => {
|
||||
test('Forward button clicked triggers appropriate navigation when safelite shop', () => {
|
||||
// Arrange
|
||||
const wrapper = shallowMount(contactDetails, getMountOptions({
|
||||
const mountOptions = getMountOptions({
|
||||
router: {
|
||||
navigate: jest.fn()
|
||||
},
|
||||
navigationScenarios
|
||||
});
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
serviceLocation: { IsSafeliteProvider: true }
|
||||
}
|
||||
}));
|
||||
};
|
||||
mountOptions.global.plugins = [createTestingPinia({
|
||||
initialState: {
|
||||
main: mainInitialState
|
||||
}
|
||||
})];
|
||||
const wrapper = shallowMount(contactDetails, mountOptions);
|
||||
|
||||
// Act
|
||||
wrapper.vm.forwardButtonAction();
|
||||
|
|
@ -262,7 +274,35 @@ describe('contactDetails.vue', () => {
|
|||
// Assert
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
|
||||
expect(wrapper.vm.$router.navigate)
|
||||
.toHaveBeenCalledWith(navigationScenarios.CLICKED_FORWARD, undefined);
|
||||
.toHaveBeenCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE_SHOP, undefined);
|
||||
});
|
||||
test('Forward button clicked triggers appropriate navigation when TPA shop', () => {
|
||||
// Arrange
|
||||
const mountOptions = getMountOptions({
|
||||
router: {
|
||||
navigate: jest.fn()
|
||||
},
|
||||
navigationScenarios
|
||||
});
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
serviceLocation: { IsSafeliteProvider: false }
|
||||
}
|
||||
};
|
||||
mountOptions.global.plugins = [createTestingPinia({
|
||||
initialState: {
|
||||
main: mainInitialState
|
||||
}
|
||||
})];
|
||||
const wrapper = shallowMount(contactDetails, mountOptions);
|
||||
|
||||
// Act
|
||||
wrapper.vm.forwardButtonAction();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalled();
|
||||
expect(wrapper.vm.$router.navigate)
|
||||
.toHaveBeenCalledWith(navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP, undefined);
|
||||
});
|
||||
test('Forward button click updates contact info', () => {
|
||||
// Arrange
|
||||
|
|
|
|||
Loading…
Reference in a new issue