Merge pull request #736 from Safelite/feature/richardson/SSR-1359
hide payment options if amountDue = 0
This commit is contained in:
commit
bb152140ea
2 changed files with 19 additions and 9 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue