Merge branch 'develop' into feature/SSR-1089
This commit is contained in:
commit
65636a11ed
4 changed files with 54 additions and 10 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
|
||||
|
|
|
|||
|
|
@ -196,10 +196,10 @@ export default {
|
|||
notesForTechnician: this.notesForTechnician
|
||||
};
|
||||
useMainStore().updateContactInfo(contactInfo);
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD,
|
||||
this.$route
|
||||
);
|
||||
const scenario = useMainStore().order.serviceLocation.IsSafeliteProvider === false
|
||||
? this.navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP
|
||||
: this.navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE_SHOP;
|
||||
this.$router.navigate(scenario, this.$route);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ export default {
|
|||
return [this.companyName ?? '', displayAddress, displayPhoneNumber];
|
||||
},
|
||||
getContactInfoLines() {
|
||||
const { firstName, lastName, emailAddress, phoneNumber } = useMainStore().order.contactInfo;
|
||||
const { firstName, lastName, emailAddress, phoneNumber } = useMainStore().contactInfo;
|
||||
return [
|
||||
`${firstName} ${lastName}`,
|
||||
emailAddress ?? '',
|
||||
|
|
|
|||
|
|
@ -581,8 +581,12 @@ const routingTable = () => [
|
|||
destinationIssPageValue: issPageValues.SCHEDULE_PAGE
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE_SHOP,
|
||||
destinationIssPageValue: issPageValues.SERVICE_PACKAGES
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP,
|
||||
destinationIssPageValue: issPageValues.TPA_SUBMIT
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue