Merge pull request #614 from Safelite/BRM-re-add-vin-lookup-changes-for-test-page

Re add vin lookup changes for test page so Quote page will work locally.
This commit is contained in:
bmauger 2022-07-14 15:06:38 -04:00 committed by GitHub
commit 63ec72c1ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 35 deletions

View file

@ -5,6 +5,7 @@ module.exports = {
preset: "@vue/cli-plugin-unit-jest", preset: "@vue/cli-plugin-unit-jest",
transform: { "^.+\\.vue$": "vue-jest" }, transform: { "^.+\\.vue$": "vue-jest" },
moduleFileExtensions: ["js", "vue"], moduleFileExtensions: ["js", "vue"],
modulePathIgnorePatterns: ["vin-lookup"],
collectCoverageFrom: [ collectCoverageFrom: [
"src/**/*.{js,vue}", "src/**/*.{js,vue}",
"!src/main.js", "!src/main.js",
@ -16,7 +17,8 @@ module.exports = {
"!src/layouts/reveal/**/*.vue", "!src/layouts/reveal/**/*.vue",
"!src/ux-components/text-link/**/*.vue", "!src/ux-components/text-link/**/*.vue",
"!src/common-components/question-chain/**/*.vue", "!src/common-components/question-chain/**/*.vue",
"!src/layouts/quote/**/*.vue", "!src/layouts/quote/**/*.vue", // Temporary
"!src/layouts/vin-lookup/**/*.vue", //Temporary for Quote page testing
// END // END
], // ! means exclude from coverage. ], // ! means exclude from coverage.
testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"], testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"],

View file

@ -56,19 +56,19 @@
/> />
</div> </div>
</div> </div>
<alert ref="alertInvalidZip" <alert ref="alertInvalidZip"
v-if="displayInvalidZipAlert" v-if="displayInvalidZipAlert"
class="my-4" class="my-4"
cmsWidgetName="AlertInvalidZipWidget" cmsWidgetName="AlertInvalidZipWidget"
alertClass="alert-danger" alertClass="alert-danger"
v-bind:isDismissible="false" v-bind:isDismissible="false"
/> />
<alert <alert
class="my-4" class="my-4"
:manualHeadline="AlertPerfectMatchInsuranceVerifiedHeader" :manualHeadline="AlertPerfectMatchInsuranceVerifiedHeader"
:manualCopy="AlertPerfectMatchInsuranceVerifiedBody" :manualCopy="AlertPerfectMatchInsuranceVerifiedBody"
v-model="customAlertData" v-model="customAlertData"
v-if="vinPopulatedOnPageLoad && isInsuranceVerified" v-if="vinPopulatedOnPageLoad && isInsuranceVerified"
alertClass="alert-success" alertClass="alert-success"
/> />
<alert <alert
@ -173,7 +173,7 @@ export default {
return { return {
vin: this.getVinFromStore(), vin: this.getVinFromStore(),
serviceZipCode: this.getZipFromStore(), serviceZipCode: this.getZipFromStore(),
emailAddress: this.getEmailFromStore(), emailAddress: this.getEmailFromStore(),
isCarIdDifferent: false, isCarIdDifferent: false,
customAlertData: {}, customAlertData: {},
previouslyEnteredCarId: '', previouslyEnteredCarId: '',
@ -198,7 +198,7 @@ export default {
getZipFromStore(){ getZipFromStore(){
return this.$store.getters.order.serviceLocation.zipCode; return this.$store.getters.order.serviceLocation.zipCode;
}, },
attachCustomEvents() { attachCustomEvents() {
this.prependActionToMethod(this, this.forwardButtonAction, () => { this.prependActionToMethod(this, this.forwardButtonAction, () => {
this.pushEventToGA( this.pushEventToGA(
this.$route.query[this.queryStrings.FMG_PAGE], this.$route.query[this.queryStrings.FMG_PAGE],
@ -243,9 +243,9 @@ export default {
if (this.serviceZipCode && !isZipValid) { if (this.serviceZipCode && !isZipValid) {
this.displayInvalidZipAlert = true; this.displayInvalidZipAlert = true;
return this.$refs.funnelFooter.removeLoader(); return this.$refs.funnelFooter.removeLoader();
} }
this.displayInvalidZipAlert = false; this.displayInvalidZipAlert = false;
// If either lookup fails, remove the loader and stop processing the page. // If either lookup fails, remove the loader and stop processing the page.
if (!resultMap.vehicleLookupResponse || !resultMap.serviceZipValidationResponse.isServiceable) { if (!resultMap.vehicleLookupResponse || !resultMap.serviceZipValidationResponse.isServiceable) {
// If the vehicle result is undefined, the vin entered was invalid. // If the vehicle result is undefined, the vin entered was invalid.
@ -270,7 +270,7 @@ export default {
this.previouslyEnteredCarId = resultMap.vehicleLookupResponse.carId; this.previouslyEnteredCarId = resultMap.vehicleLookupResponse.carId;
this.customAlertData.vehicleInfo = resultMap.vehicleLookupResponse; this.customAlertData.vehicleInfo = resultMap.vehicleLookupResponse;
this.displayMatchedDifferentVehicleAlert = true; this.displayMatchedDifferentVehicleAlert = true;
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(resultMap.vehicleLookupResponse.carId); this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(resultMap.vehicleLookupResponse.carId);
// Update button "Continue with..." // Update button "Continue with..."
@ -292,12 +292,12 @@ export default {
}, false); }, false);
return await this.navigateForward(); return await this.navigateForward();
} }
// If a VIN has already been found. Validate the Service Zip (in case of changes) // If a VIN has already been found. Validate the Service Zip (in case of changes)
const zipValidationResponse = await this.dispatchStoreAction(storeActions.VALIDATE_ZIP, {zip: this.serviceZipCode}); const zipValidationResponse = await this.dispatchStoreAction(storeActions.VALIDATE_ZIP, {zip: this.serviceZipCode});
// Check if Service Zip entered is serviceable // Check if Service Zip entered is serviceable
if (zipValidationResponse.data.isServiceable) { if (zipValidationResponse.data.isServiceable) {
// If the Service Zip entered is serviceable then save the Zip Info and Email Address and navigate forward // If the Service Zip entered is serviceable then save the Zip Info and Email Address and navigate forward
@ -330,12 +330,12 @@ export default {
return this.$refs.funnelFooter.removeLoader(); return this.$refs.funnelFooter.removeLoader();
}, },
async navigateForward(){ async navigateForward(){
if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) { this.$router.navigate(this.navigationScenarios.SELECTED_VIN_WITH_PART_QUESTIONS, this.$route, {}, {});
this.$router.navigate(this.navigationScenarios.SELECTED_VIN_HAS_MISMATCHED_GLASS, this.$route, {}, { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }); if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) {
} else { this.$router.navigate(this.navigationScenarios.SELECTED_VIN_HAS_MISMATCHED_GLASS, this.$route, {}, { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true });
await this.navigateForwardWithSingleCarMatch(); } else {
} await this.navigateForwardWithSingleCarMatch();
}
}, },
}, },
mounted() { mounted() {
@ -379,8 +379,8 @@ export default {
} }
else { else {
return 'XXXXXXXXXXXXXXXXX'; return 'XXXXXXXXXXXXXXXXX';
} }
}, },
}, },
watch: { watch: {
vin() { vin() {
@ -397,10 +397,10 @@ export default {
vehicleBanner, vehicleBanner,
funnelSubHeader, funnelSubHeader,
textboxQuestion, textboxQuestion,
alert, alert,
vinInformation, vinInformation,
loadingModal, loadingModal,
Form, Form,
}, },
}; };
</script> </script>

View file

@ -114,12 +114,13 @@ const routingTable = [
}, },
{ {
scenario: navigationScenarios.SELECTED_VIN_WITH_PART_QUESTIONS, scenario: navigationScenarios.SELECTED_VIN_WITH_PART_QUESTIONS,
destinationFmgPageValue: fmgPageValues.PART_QUESTIONS //destinationFmgPageValue: fmgPageValues.PART_QUESTIONS
destinationFmgPageValue: fmgPageValues.QUOTE,
}, },
{ {
scenario: navigationScenarios.SELECTED_VIN_WITH_MULTIPLE_PARTS, scenario: navigationScenarios.SELECTED_VIN_WITH_MULTIPLE_PARTS,
destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS
} },
], ],
}, },
{ {
@ -178,7 +179,7 @@ const routingTable = [
{ {
scenario: navigationScenarios.CLICKED_FORWARD, scenario: navigationScenarios.CLICKED_FORWARD,
destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
}, },
{ {
scenario: navigationScenarios.SELECTED_VIN_WITH_PART_QUESTIONS, scenario: navigationScenarios.SELECTED_VIN_WITH_PART_QUESTIONS,
destinationFmgPageValue: fmgPageValues.PART_QUESTIONS destinationFmgPageValue: fmgPageValues.PART_QUESTIONS
@ -186,11 +187,7 @@ const routingTable = [
{ {
scenario: navigationScenarios.SELECTED_VIN_WITH_MULTIPLE_PARTS, scenario: navigationScenarios.SELECTED_VIN_WITH_MULTIPLE_PARTS,
destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS
}, }
{
scenario: navigationScenarios.SELECTED_PROVIDE_VIN_DIFFERENT_WAY,
destinationFmgPageValue: fmgPageValues.ESTIMATE
}
], ],
}, },
{ {
@ -233,4 +230,4 @@ const routingTable = [
}, },
]; ];
export { routingTable }; export { routingTable };