diff --git a/src/layouts/payment-method/payment-method.spec.js b/src/layouts/payment-method/payment-method.spec.js index 3e526b84..acfaeafe 100644 --- a/src/layouts/payment-method/payment-method.spec.js +++ b/src/layouts/payment-method/payment-method.spec.js @@ -184,9 +184,10 @@ describe('payment-method.vue', () => { // Assert expect(result).toBeTruthy(); }); - test('returns false when coverageStatus is verified', () => { + test('returns false when coverageStatus is verified and deductibleTotal > 0', () => { // Arrange store.order.insuranceCoverage.coverageStatus = coverageStatuses.VERIFIED; + store.order.currentDeductible = 34.99; const wrapper = setupMocks({}, store, mixin); // Act @@ -195,6 +196,18 @@ describe('payment-method.vue', () => { // Assert expect(result).toBeFalsy(); }); + test('returns true when coverageStatus is verified and deductibleTotal = 0', () => { + // Arrange + store.order.insuranceCoverage.coverageStatus = coverageStatuses.VERIFIED; + store.order.currentDeductible = 0; + const wrapper = setupMocks({}, store, mixin); + + // Act + const result = wrapper.vm.isPayInAdvanceDisabled; + + // Assert + expect(result).toBeTruthy(); + }); test('returns true when pia not enabled', () => { // Arrange mixin = { diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 164c6bbe..7dee7636 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -187,8 +187,9 @@ export default { isPayInAdvanceDisabled() { const piaExperience = this.getSettingValue(experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE); const isEnabled = piaExperience === 'true'; + const isDeductibleTotalEqualToZero = useMainStore().order.currentDeductible === 0; - return !isEnabled || useMainStore().isUnverified; + return !isEnabled || useMainStore().isUnverified || (useMainStore().isDeductible && isDeductibleTotalEqualToZero); }, paymentMethod() { return this.paymentMethodInternalModel; @@ -242,11 +243,8 @@ export default { && providerLocation.zipCode ); - const isMobile = - serviceLocation.appointmentType - === AppointmentTypeStrings.MOBILE - || serviceLocation.appointmentType - === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP; + const isMobile = serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE + || serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP; const serviceLocationReqs = (isMobile && mobileReqs) || (!isMobile && dropOffInshopReqs); @@ -262,8 +260,7 @@ export default { ); // Customer - const { firstName, lastName, emailAddress } = - useMainStore().order.customer; + const { firstName, lastName, emailAddress } = useMainStore().order.customer; const customerReqs = !!(firstName && lastName && emailAddress); // Contact Info