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

View file

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