Merge pull request #2464 from Safelite/feature/CASH-376
CASH-376 form validation fix
This commit is contained in:
commit
b5eade8a70
3 changed files with 15 additions and 5 deletions
|
|
@ -148,6 +148,7 @@ export default {
|
||||||
zipCode: "",
|
zipCode: "",
|
||||||
},
|
},
|
||||||
isVehicleProtected: null,
|
isVehicleProtected: null,
|
||||||
|
isMobileSelected: false,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
mobileFeePart: {
|
mobileFeePart: {
|
||||||
|
|
|
||||||
|
|
@ -353,6 +353,7 @@ describe("service-location.vue", () => {
|
||||||
zipCode: "43054",
|
zipCode: "43054",
|
||||||
},
|
},
|
||||||
isVehicleProtected: true,
|
isVehicleProtected: true,
|
||||||
|
isMobileSelected: true,
|
||||||
};
|
};
|
||||||
wrapper.vm.mobileLocationQuestions = mobileLocationQuestions;
|
wrapper.vm.mobileLocationQuestions = mobileLocationQuestions;
|
||||||
|
|
||||||
|
|
@ -365,6 +366,7 @@ describe("service-location.vue", () => {
|
||||||
zipCode: "61606",
|
zipCode: "61606",
|
||||||
},
|
},
|
||||||
isVehicleProtected: null,
|
isVehicleProtected: null,
|
||||||
|
isMobileSelected: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -467,6 +469,7 @@ describe("service-location.vue", () => {
|
||||||
zipCode: "",
|
zipCode: "",
|
||||||
},
|
},
|
||||||
isVehicleProtected: null,
|
isVehicleProtected: null,
|
||||||
|
isMobileSelected: false,
|
||||||
};
|
};
|
||||||
wrapper.vm.mobileLocationQuestions = mobileLocationQuestions;
|
wrapper.vm.mobileLocationQuestions = mobileLocationQuestions;
|
||||||
const newMobileLocationQuestions = {
|
const newMobileLocationQuestions = {
|
||||||
|
|
@ -478,6 +481,7 @@ describe("service-location.vue", () => {
|
||||||
zipCode: "43054",
|
zipCode: "43054",
|
||||||
},
|
},
|
||||||
isVehicleProtected: true,
|
isVehicleProtected: true,
|
||||||
|
isMobileSelected: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
wrapper.vm.closeModalAction = jest.fn();
|
wrapper.vm.closeModalAction = jest.fn();
|
||||||
|
|
@ -527,6 +531,7 @@ describe("service-location.vue", () => {
|
||||||
zipCode: "",
|
zipCode: "",
|
||||||
},
|
},
|
||||||
isVehicleProtected: null,
|
isVehicleProtected: null,
|
||||||
|
isMobileSelected: false,
|
||||||
mobileFeePart: null,
|
mobileFeePart: null,
|
||||||
};
|
};
|
||||||
wrapper.vm.mobileLocationQuestions = mobileLocationQuestions;
|
wrapper.vm.mobileLocationQuestions = mobileLocationQuestions;
|
||||||
|
|
@ -540,6 +545,7 @@ describe("service-location.vue", () => {
|
||||||
zipCode: "43081",
|
zipCode: "43081",
|
||||||
},
|
},
|
||||||
isVehicleProtected: true,
|
isVehicleProtected: true,
|
||||||
|
isMobileSelected: true,
|
||||||
mobileFeePart: null,
|
mobileFeePart: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -603,6 +609,7 @@ describe("service-location.vue", () => {
|
||||||
zipCode: "43081",
|
zipCode: "43081",
|
||||||
},
|
},
|
||||||
isVehicleProtected: "YesAnswer",
|
isVehicleProtected: "YesAnswer",
|
||||||
|
isMobileSelected: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
wrapper.vm.closeModalAction = jest.fn();
|
wrapper.vm.closeModalAction = jest.fn();
|
||||||
|
|
|
||||||
|
|
@ -171,11 +171,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.addressQuestions.streetAddress ||
|
value.isMobileSelected &&
|
||||||
|
(!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)
|
||||||
) {
|
) {
|
||||||
return errorMessages.MOBILE_LOCATION_REQUIRED;
|
return errorMessages.MOBILE_LOCATION_REQUIRED;
|
||||||
}
|
}
|
||||||
|
|
@ -297,6 +298,7 @@ export default {
|
||||||
zipCode: this.zipCode,
|
zipCode: this.zipCode,
|
||||||
},
|
},
|
||||||
isVehicleProtected: this.isVehicleProtected,
|
isVehicleProtected: this.isVehicleProtected,
|
||||||
|
isMobileSelected: this.selectedAppointmentType === "Mobile",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue