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