final updates to welcome-page navigation
This commit is contained in:
parent
bac3c17dae
commit
c09f09543f
4 changed files with 24 additions and 20 deletions
|
|
@ -88,7 +88,7 @@ describe("navigation", () => {
|
|||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(
|
||||
navigationScenarios.CLICKED_FORWARD_WITH_POLICY_AND_VEHICLES,
|
||||
navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES,
|
||||
undefined,
|
||||
{},
|
||||
{},
|
||||
|
|
@ -118,7 +118,7 @@ describe("navigation", () => {
|
|||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(
|
||||
navigationScenarios.CLICKED_FORWARD_WITH_POLICY_AND_NO_VEHICLES,
|
||||
navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES,
|
||||
undefined
|
||||
);
|
||||
});
|
||||
|
|
@ -141,7 +141,7 @@ describe("navigation", () => {
|
|||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(
|
||||
navigationScenarios.CLICKED_FORWARD_WITH_NO_POLICY,
|
||||
navigationScenarios.CLICKED_FORWARD_POLICY_UNVERIFIED,
|
||||
undefined
|
||||
);
|
||||
});
|
||||
|
|
@ -165,7 +165,7 @@ describe("navigation", () => {
|
|||
|
||||
// Assert
|
||||
expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith(
|
||||
navigationScenarios.CLICKED_FORWARD_WITH_NO_POLICY,
|
||||
navigationScenarios.CLICKED_FORWARD_POLICY_UNVERIFIED,
|
||||
undefined
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -260,14 +260,14 @@ export default {
|
|||
const policyLookupResultMap = await settleAllPromises(promisePolicyLookupResultMap);
|
||||
const policyInfo = policyLookupResultMap.policyLookupResponse;
|
||||
|
||||
// if policy lookup fails, navigate to policy-holder-details page
|
||||
// if policy lookup fails, navigate directly to policy-holder-details page
|
||||
if (!policyInfo) {
|
||||
this.navigateForward();
|
||||
}
|
||||
|
||||
const policy = policyInfo.policies?.[0];
|
||||
// get the first 5 digits of the policy zip code
|
||||
const policyZip = (policy.insureds?.[0]?.zipCode).slice(0, 5);
|
||||
const policyZip = (policy?.insureds?.[0]?.zipCode)?.slice(0, 5);
|
||||
// check if policy zip enters matches zip on policy
|
||||
this.zipCodeMatch = policyZip == this.welcomePageModel.policyZipCode;
|
||||
|
||||
|
|
@ -292,7 +292,7 @@ export default {
|
|||
// if policy lookup is unsuccessful, navigate to policy-holder-details page
|
||||
if (!policy || !zipCodeMatch) {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD_WITH_NO_POLICY,
|
||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_UNVERIFIED,
|
||||
this.$route
|
||||
);
|
||||
}
|
||||
|
|
@ -300,14 +300,14 @@ export default {
|
|||
// navigate to vehicle-selection page (manual entry)
|
||||
else if (policy && zipCodeMatch && !this.vehiclesFound) {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD_WITH_POLICY_AND_NO_VEHICLES,
|
||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES,
|
||||
this.$route
|
||||
);
|
||||
}
|
||||
// if policy lookup is successful and vehicles are found, navigate to policy-vehicles page
|
||||
else if (policy && zipCodeMatch && this.vehiclesFound) {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD_WITH_POLICY_AND_VEHICLES,
|
||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES,
|
||||
this.$route,
|
||||
{},
|
||||
{},
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ const navigationScenarios = {
|
|||
MOVE_FORWARD_ENTRY_PAGE: "MOVE_FORWARD_ENTRY_PAGE",
|
||||
|
||||
// Welcome
|
||||
CLICKED_FORWARD_WITH_POLICY_AND_VEHICLES: "CLICKED_FORWARD_WITH_POLICY_AND_VEHICLES",
|
||||
CLICKED_FORWARD_WITH_NO_POLICY: "CLICKED_FORWARD_WITH_NO_POLICY",
|
||||
CLICKED_FORWARD_WITH_POLICY_AND_NO_VEHICLES: "CLICKED_FORWARD_WITH_POLICY_AND_NO_VEHICLES",
|
||||
CLICKED_FORWARD_POLICY_UNVERIFIED: "CLICKED_FORWARD_POLICY_UNVERIFIED",
|
||||
CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES: "CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES",
|
||||
CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES: "CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES",
|
||||
|
||||
// YMMS
|
||||
SELECTED_YEAR: "SELECTED_YEAR",
|
||||
|
|
|
|||
|
|
@ -392,16 +392,20 @@ const routingTable = function(store) {
|
|||
destinationIssPageValue: issPageValues.WELCOME_PAGE
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_POLICY_AND_VEHICLES,
|
||||
destinationIssPageValue: issPageValues.POLICY_VEHICLES
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_POLICY,
|
||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||
destinationIssPageValue: issPageValues.POLICY_HOLDER_DETAILS
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_POLICY_AND_NO_VEHICLES,
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_POLICY_UNVERIFIED,
|
||||
destinationIssPageValue: issPageValues.POLICY_HOLDER_DETAILS
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES,
|
||||
destinationIssPageValue: issPageValues.VEHICLE_SELECTION
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES,
|
||||
destinationIssPageValue: issPageValues.POLICY_VEHICLES
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -414,12 +418,12 @@ const routingTable = function(store) {
|
|||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_POLICY_UNVERIFIED,
|
||||
destinationIssPageValue: issPageValues.VEHICLE_YEAR
|
||||
destinationIssPageValue: issPageValues.VEHICLE_SELECTION
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED,
|
||||
destinationIssPageValue: issPageValues.POLICY_VEHICLES
|
||||
}
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue