mobile validation
This commit is contained in:
hiteshkumar87 2025-05-16 16:23:26 +05:30
parent 503eca1927
commit 85bc78dc27
2 changed files with 10 additions and 2 deletions

View file

@ -355,6 +355,7 @@ describe("service-location.vue", () => {
zipCode: "61606", zipCode: "61606",
}, },
isVehicleProtected: null, isVehicleProtected: null,
isMobileSelected: false,
}; };
// Act // Act
@ -468,6 +469,7 @@ describe("service-location.vue", () => {
zipCode: "43054", zipCode: "43054",
}, },
isVehicleProtected: true, isVehicleProtected: true,
isMobileSelected: false,
}; };
//wrapper.vm.closeModalAction = jest.fn(); //wrapper.vm.closeModalAction = jest.fn();

View file

@ -175,12 +175,12 @@ const MOBILE_FEE_PART_TYPE = "MOBILE FEE";
// DEFINE VALIDATION RULES // DEFINE VALIDATION RULES
defineRule("mobile-location-required", (value) => { defineRule("mobile-location-required", (value) => {
if ( if (
value.isMobileSelected &&
(!value.addressQuestions.streetAddress || (!value.addressQuestions.streetAddress ||
!value.addressQuestions.city || !value.addressQuestions.city ||
!value.addressQuestions.state || !value.addressQuestions.state ||
!value.addressQuestions.zipCode || !value.addressQuestions.zipCode ||
!value.isVehicleProtected) && !value.isVehicleProtected)
value.isMobileSelected
) { ) {
return errorMessages.MOBILE_LOCATION_REQUIRED; return errorMessages.MOBILE_LOCATION_REQUIRED;
} }
@ -305,9 +305,15 @@ export default {
zipCode: this.zipCode, zipCode: this.zipCode,
}, },
isVehicleProtected: this.isVehicleProtected, isVehicleProtected: this.isVehicleProtected,
isMobileSelected:
this.selectedAppointmentType === AppointmentTypeStrings.MOBILE &&
!this.isMobileLocationOpened,
}; };
}, },
}, },
isMobileLocationOpened() {
return this.$refs.mobileLocationQuestions.isMobileLocationOpened;
},
isServiceableMobile() { isServiceableMobile() {
if (this.isRecalibrationServiceableMobile !== null) { if (this.isRecalibrationServiceableMobile !== null) {
return ( return (