From 85bc78dc27f5be4d7af85cb4f9c3f25979c345d5 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Fri, 16 May 2025 16:23:26 +0530 Subject: [PATCH] CASH-710 mobile validation --- src/layouts/service-location/service-location.spec.js | 2 ++ src/layouts/service-location/service-location.vue | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/layouts/service-location/service-location.spec.js b/src/layouts/service-location/service-location.spec.js index 24030fb1f..8a8b7ae55 100644 --- a/src/layouts/service-location/service-location.spec.js +++ b/src/layouts/service-location/service-location.spec.js @@ -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(); diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 3b37c8406..2690f09d4 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -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 (