Changes after code reviewed by Mark
This commit is contained in:
parent
9c68844fdb
commit
5f155d53da
2 changed files with 12 additions and 14 deletions
|
|
@ -153,6 +153,7 @@ describe("vin-lookup.vue", () => {
|
||||||
const zipPromise = Promise.resolve(zipValidationApiResponse);
|
const zipPromise = Promise.resolve(zipValidationApiResponse);
|
||||||
|
|
||||||
wrapper.vm.validateZip = jest.fn().mockImplementation(() => zipPromise);
|
wrapper.vm.validateZip = jest.fn().mockImplementation(() => zipPromise);
|
||||||
|
wrapper.vm.setupUiForNonServiceableZip = jest.fn();
|
||||||
wrapper.vm.navigateForward = jest.fn();
|
wrapper.vm.navigateForward = jest.fn();
|
||||||
|
|
||||||
wrapper.vm.previouslyEnteredCarId = 'new carId';
|
wrapper.vm.previouslyEnteredCarId = 'new carId';
|
||||||
|
|
|
||||||
|
|
@ -323,19 +323,15 @@ export default {
|
||||||
const vehicleLookup = this.lookupVehicle(vinToLookup);
|
const vehicleLookup = this.lookupVehicle(vinToLookup);
|
||||||
|
|
||||||
zipValidationResponse = await zipValidation;
|
zipValidationResponse = await zipValidation;
|
||||||
vehicleLookupResponse = await vehicleLookup.catch((response) => {
|
vehicleLookupResponse = await vehicleLookup.catch(() => {
|
||||||
if (response.status == StatusCodes.NOT_FOUND) {
|
this.vinNotFound = true;
|
||||||
this.vinNotFound = true;
|
this.$refs.funnelFooter.removeLoader();
|
||||||
this.$refs.funnelFooter.removeLoader();
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check if Service Zip entered is servicable, if not display an alert
|
// Check if Service Zip entered is servicable, if not display an alert
|
||||||
if (!zipValidationResponse.data.isServiceable) {
|
if (!zipValidationResponse.data.isServiceable) {
|
||||||
this.customAlertData.zip = this.zip;
|
this.setupUiForNonServiceableZip(this.zip);
|
||||||
this.noServiceZip = true;
|
|
||||||
this.invalidZip = this.zip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vehicleLookupResponse || !zipValidationResponse.data.isServiceable) {
|
if (!vehicleLookupResponse || !zipValidationResponse.data.isServiceable) {
|
||||||
|
|
@ -347,13 +343,9 @@ export default {
|
||||||
|
|
||||||
// Check if Service Zip entered is serviceable, if not display an alert
|
// Check if Service Zip entered is serviceable, if not display an alert
|
||||||
if (!zipValidationResponse.data.isServiceable) {
|
if (!zipValidationResponse.data.isServiceable) {
|
||||||
this.customAlertData.zip = this.zip;
|
this.setupUiForNonServiceableZip(this.zip);
|
||||||
this.noServiceZip = true;
|
|
||||||
this.invalidZip = this.zip;
|
|
||||||
this.$refs.funnelFooter.removeLoader();
|
this.$refs.funnelFooter.removeLoader();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.navigateForward();
|
this.navigateForward();
|
||||||
return;
|
return;
|
||||||
|
|
@ -420,6 +412,11 @@ export default {
|
||||||
store.commit(storeMutations.UPDATE_SERVICE_LOCATION_STATE, zipInfo.state);
|
store.commit(storeMutations.UPDATE_SERVICE_LOCATION_STATE, zipInfo.state);
|
||||||
store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.email);
|
store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.email);
|
||||||
},
|
},
|
||||||
|
setupUiForNonServiceableZip(zip) {
|
||||||
|
this.customAlertData.zip = zip;
|
||||||
|
this.invalidZip = zip;
|
||||||
|
this.noServiceZip = true;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Form,
|
Form,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue