Fixed some issues caused by co-pilot changes.
This commit is contained in:
parent
e516aea577
commit
ecfbfb9588
2 changed files with 18 additions and 27 deletions
|
|
@ -402,7 +402,7 @@ describe('duplicateCheck.vue', () => {
|
||||||
expect(wrapper.vm.mainStore.getCoveragePolicyInfo).toHaveBeenCalledTimes(1);
|
expect(wrapper.vm.mainStore.getCoveragePolicyInfo).toHaveBeenCalledTimes(1);
|
||||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledTimes(1);
|
expect(wrapper.vm.$router.navigate).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
test('Load session throws error => still navigate forward', async () => {
|
test('Load session throws error => should bailout, should not navigate forward', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const selectedAnswer = getRandomString(6, 6);
|
const selectedAnswer = getRandomString(6, 6);
|
||||||
const { wrapper } = getMountedComponent({
|
const { wrapper } = getMountedComponent({
|
||||||
|
|
@ -431,7 +431,7 @@ describe('duplicateCheck.vue', () => {
|
||||||
expect(wrapper.vm.mainStore.loadSessionFromDuplicate).toHaveBeenCalledTimes(1);
|
expect(wrapper.vm.mainStore.loadSessionFromDuplicate).toHaveBeenCalledTimes(1);
|
||||||
expect(saveSession).not.toHaveBeenCalled();
|
expect(saveSession).not.toHaveBeenCalled();
|
||||||
expect(wrapper.vm.mainStore.getCoveragePolicyInfo).toHaveBeenCalledTimes(1);
|
expect(wrapper.vm.mainStore.getCoveragePolicyInfo).toHaveBeenCalledTimes(1);
|
||||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledTimes(1);
|
expect(wrapper.vm.$router.navigate).not.toHaveBeenCalledWith();
|
||||||
});
|
});
|
||||||
test('coverageType deductible and policy vehicles returned => CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES', async () => {
|
test('coverageType deductible and policy vehicles returned => CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,6 @@ export default {
|
||||||
showIssLoadingModal(true);
|
showIssLoadingModal(true);
|
||||||
|
|
||||||
let callSaveSession = false;
|
let callSaveSession = false;
|
||||||
let selectedReferral = null;
|
|
||||||
|
|
||||||
// If user clicked forward without selecting an option or user click on "start a new claim" button.
|
// If user clicked forward without selecting an option or user click on "start a new claim" button.
|
||||||
if (this.selectedAnswer == null || this.selectedAnswer === 'NewClaim') {
|
if (this.selectedAnswer == null || this.selectedAnswer === 'NewClaim') {
|
||||||
|
|
@ -148,41 +147,33 @@ export default {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
selectedReferral =
|
const selectedReferral =
|
||||||
this.mainStore.applicationUser.duplicateOrders.find((o) => o.correlationId === this.selectedAnswer);
|
this.mainStore.applicationUser.duplicateOrders.find((o) => o.correlationId === this.selectedAnswer);
|
||||||
|
|
||||||
if (!selectedReferral) {
|
if (selectedReferral) {
|
||||||
|
// LoadSession will bailout on error.
|
||||||
|
await this.mainStore.loadSessionFromDuplicate(selectedReferral);
|
||||||
|
}
|
||||||
|
else {
|
||||||
// If duplicate not found in list (unable to load), then call SaveSession to create referral.
|
// If duplicate not found in list (unable to load), then call SaveSession to create referral.
|
||||||
callSaveSession = true;
|
callSaveSession = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call LoadSession if duplicate was found.
|
try
|
||||||
if (selectedReferral) {
|
{
|
||||||
try {
|
// Call SaveSession to create referral.
|
||||||
await this.mainStore.loadSessionFromDuplicate(selectedReferral);
|
if ( callSaveSession ) {
|
||||||
}
|
// SaveSession will bailout on error.
|
||||||
catch (error) {
|
|
||||||
// LoadSession will bailout.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Call SaveSession to create referral.
|
|
||||||
if (callSaveSession) {
|
|
||||||
try {
|
|
||||||
await saveSession({ shouldAwaitSaveSessionQueue: true, bailoutOnError: true });
|
await saveSession({ shouldAwaitSaveSessionQueue: true, bailoutOnError: true });
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
// SaveSession will bailout.
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Call getCoveragePolicyInfo to get the policy info.
|
||||||
// Call getCoveragePolicyInfo to get the policy info.
|
|
||||||
try {
|
|
||||||
await this.mainStore.getCoveragePolicyInfo();
|
await this.mainStore.getCoveragePolicyInfo();
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
// GetCoveragePolicyInfo handles exception / error internally.
|
// No error handling here needed.
|
||||||
|
// GetCoveragePolicyInfo handles exception / error internally. We do not care if it fails, user continues in unverified path.
|
||||||
}
|
}
|
||||||
|
|
||||||
this.pushEventToGA("policy_search", "policy_found", this.mainStore.isPolicyLookupSuccessful ? "Yes" : "No", true);
|
this.pushEventToGA("policy_search", "policy_found", this.mainStore.isPolicyLookupSuccessful ? "Yes" : "No", true);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue