remove logic for verifying policy zip
This commit is contained in:
parent
c5984c5244
commit
b8a72d7f41
2 changed files with 6 additions and 39 deletions
|
|
@ -76,7 +76,6 @@ describe("navigation", () => {
|
||||||
|
|
||||||
await wrapper.setData({
|
await wrapper.setData({
|
||||||
isCoverageEnabled: true,
|
isCoverageEnabled: true,
|
||||||
zipCodeMatch: true,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
useMainStore().order.policy.policyNumber = "p_0001";
|
useMainStore().order.policy.policyNumber = "p_0001";
|
||||||
|
|
@ -105,7 +104,6 @@ describe("navigation", () => {
|
||||||
isCoverageEnabled: true,
|
isCoverageEnabled: true,
|
||||||
vehiclesCount: 0,
|
vehiclesCount: 0,
|
||||||
vehiclesFound: null,
|
vehiclesFound: null,
|
||||||
zipCodeMatch: true,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
useMainStore().order.policy.policyNumber = "p_0001";
|
useMainStore().order.policy.policyNumber = "p_0001";
|
||||||
|
|
@ -145,31 +143,6 @@ describe("navigation", () => {
|
||||||
undefined
|
undefined
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
test("if zip code entered does not match zip on policy, navigate to policy-holder-details page", async () => {
|
|
||||||
// Arrange
|
|
||||||
const { wrapper } = setupMocks({
|
|
||||||
policies: [{}]
|
|
||||||
});
|
|
||||||
|
|
||||||
await wrapper.setData({
|
|
||||||
isCoverageEnabled: true,
|
|
||||||
zipCodeMatch: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
useMainStore().order.policy.policyNumber = "p_0001";
|
|
||||||
useMainStore().order.policy.dateOfLoss = "2022-01-28";
|
|
||||||
useMainStore().order.accountNumber = "00000";
|
|
||||||
|
|
||||||
// Act
|
|
||||||
await wrapper.vm.navigateForward();
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(
|
|
||||||
navigationScenarios.CLICKED_FORWARD_POLICY_UNVERIFIED,
|
|
||||||
undefined
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function setupMocks({
|
function setupMocks({
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,6 @@ export default {
|
||||||
return {
|
return {
|
||||||
welcomePageModel: this.getWelcomePageModelFromStore(),
|
welcomePageModel: this.getWelcomePageModelFromStore(),
|
||||||
vehiclesFound: [],
|
vehiclesFound: [],
|
||||||
zipCodeMatch: false,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
|
|
@ -266,12 +265,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const policy = policyInfo.policies?.[0];
|
const policy = policyInfo.policies?.[0];
|
||||||
// get the first 5 digits of the policy zip code
|
if (policy) {
|
||||||
const policyZip = (policy?.insureds?.[0]?.zipCode)?.slice(0, 5);
|
|
||||||
// check if policy zip enters matches zip on policy
|
|
||||||
this.zipCodeMatch = policyZip == this.welcomePageModel.policyZipCode;
|
|
||||||
|
|
||||||
if (policy && this.zipCodeMatch) {
|
|
||||||
//populate policy holder details from policy lookup
|
//populate policy holder details from policy lookup
|
||||||
this.mainStore.order.customer.address.streetAddress = policy.insureds?.[0]?.address;
|
this.mainStore.order.customer.address.streetAddress = policy.insureds?.[0]?.address;
|
||||||
this.mainStore.order.customer.address.city = policy.insureds?.[0]?.city;
|
this.mainStore.order.customer.address.city = policy.insureds?.[0]?.city;
|
||||||
|
|
@ -283,14 +277,14 @@ export default {
|
||||||
//populate vehicles
|
//populate vehicles
|
||||||
this.vehiclesFound = policy.vehicles;
|
this.vehiclesFound = policy.vehicles;
|
||||||
}
|
}
|
||||||
return this.navigateForward(policy, this.zipCodeMatch);
|
return this.navigateForward(policy);
|
||||||
}
|
}
|
||||||
return this.navigateForward();
|
return this.navigateForward();
|
||||||
},
|
},
|
||||||
|
|
||||||
navigateForward(policy, zipCodeMatch) {
|
navigateForward(policy) {
|
||||||
// if policy lookup is unsuccessful, navigate to policy-holder-details page
|
// if policy lookup is unsuccessful, navigate to policy-holder-details page
|
||||||
if (!policy || !zipCodeMatch) {
|
if (!policy) {
|
||||||
this.$router.navigate(
|
this.$router.navigate(
|
||||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_UNVERIFIED,
|
this.navigationScenarios.CLICKED_FORWARD_POLICY_UNVERIFIED,
|
||||||
this.$route
|
this.$route
|
||||||
|
|
@ -298,14 +292,14 @@ export default {
|
||||||
}
|
}
|
||||||
// if policy lookup is successful, but no vehicles are associated with the policy
|
// if policy lookup is successful, but no vehicles are associated with the policy
|
||||||
// navigate to vehicle-selection page (manual entry)
|
// navigate to vehicle-selection page (manual entry)
|
||||||
else if (policy && zipCodeMatch && !this.vehiclesFound) {
|
else if (policy && !this.vehiclesFound) {
|
||||||
this.$router.navigate(
|
this.$router.navigate(
|
||||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES,
|
this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES,
|
||||||
this.$route
|
this.$route
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// if policy lookup is successful and vehicles are found, navigate to policy-vehicles page
|
// if policy lookup is successful and vehicles are found, navigate to policy-vehicles page
|
||||||
else if (policy && zipCodeMatch && this.vehiclesFound) {
|
else if (policy && this.vehiclesFound) {
|
||||||
this.$router.navigate(
|
this.$router.navigate(
|
||||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES,
|
this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES,
|
||||||
this.$route,
|
this.$route,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue