Fix failing tests, remove no longer needed test
This commit is contained in:
parent
00dacdbbb8
commit
a98304530c
2 changed files with 20 additions and 35 deletions
|
|
@ -45,7 +45,8 @@ function setupMocks({ customMountOptions = {}, queryString }, mainInitialState =
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'false';
|
return 'false';
|
||||||
})
|
}),
|
||||||
|
savePageDataToStore: jest.fn()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const cmsMixin = {
|
const cmsMixin = {
|
||||||
|
|
@ -84,33 +85,10 @@ describe('payment-method.vue', () => {
|
||||||
const wrapper = setupMocks({}, store);
|
const wrapper = setupMocks({}, store);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const paymethod = wrapper.vm.getPaymentMethodFromStore();
|
wrapper.vm.initializeComponent();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(paymethod).toBe(payLaterMethod);
|
expect(wrapper.vm.paymentMethod).toBe(payLaterMethod);
|
||||||
});
|
|
||||||
test('getting payment method when method is pay in advance', async () => {
|
|
||||||
// Arrange
|
|
||||||
const payInAdvanceMethod = paymentMethods.CREDIT_CARD;
|
|
||||||
const store = {
|
|
||||||
order: {
|
|
||||||
payment: {
|
|
||||||
paymentMethod: payInAdvanceMethod
|
|
||||||
},
|
|
||||||
insuranceCoverage: {
|
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
|
||||||
coverageType: coverageType.Deductible
|
|
||||||
},
|
|
||||||
currentDeductible: 1000
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const wrapper = setupMocks({}, store);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
const paymethod = wrapper.vm.getPaymentMethodFromStore();
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
expect(paymethod).toBe(payInAdvanceMethod);
|
|
||||||
});
|
});
|
||||||
test('getting PAY_AT_TIME_OF_SERVICE when deductible is 0', async () => {
|
test('getting PAY_AT_TIME_OF_SERVICE when deductible is 0', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -124,16 +102,18 @@ describe('payment-method.vue', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: coverageType.Deductible
|
coverageType: coverageType.Deductible
|
||||||
},
|
},
|
||||||
currentDeductible: 0
|
currentDeductible: {
|
||||||
|
replace: 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const wrapper = setupMocks({}, store);
|
const wrapper = setupMocks({}, store);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const paymethod = wrapper.vm.getPaymentMethodFromStore();
|
wrapper.vm.initializeComponent();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(paymethod).toBe(payInAdvanceMethod);
|
expect(wrapper.vm.paymentMethod).toBe(payInAdvanceMethod);
|
||||||
});
|
});
|
||||||
test('getting PAY_AT_TIME_OF_SERVICE when Unverified', async () => {
|
test('getting PAY_AT_TIME_OF_SERVICE when Unverified', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -147,16 +127,18 @@ describe('payment-method.vue', () => {
|
||||||
coverageStatus: coverageStatuses.PENDING,
|
coverageStatus: coverageStatuses.PENDING,
|
||||||
coverageType: coverageType.Deductible
|
coverageType: coverageType.Deductible
|
||||||
},
|
},
|
||||||
currentDeductible: 1000
|
currentDeductible: {
|
||||||
|
replace: 1000
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const wrapper = setupMocks({}, store);
|
const wrapper = setupMocks({}, store);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const paymethod = wrapper.vm.getPaymentMethodFromStore();
|
wrapper.vm.initializeComponent();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(paymethod).toBe(payInAdvanceMethod);
|
expect(wrapper.vm.paymentMethod).toBe(payInAdvanceMethod);
|
||||||
});
|
});
|
||||||
test('getting PAY_AT_TIME_OF_SERVICE when PIA Experiment disabled', async () => {
|
test('getting PAY_AT_TIME_OF_SERVICE when PIA Experiment disabled', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -180,16 +162,18 @@ describe('payment-method.vue', () => {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
coverageType: coverageType.Deductible
|
coverageType: coverageType.Deductible
|
||||||
},
|
},
|
||||||
currentDeductible: 1000
|
currentDeductible: {
|
||||||
|
replace: 1000
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const wrapper = setupMocks({}, store, mixin);
|
const wrapper = setupMocks({}, store, mixin);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const paymethod = wrapper.vm.getPaymentMethodFromStore();
|
wrapper.vm.initializeComponent();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(paymethod).toBe(payInAdvanceMethod);
|
expect(wrapper.vm.paymentMethod).toBe(payInAdvanceMethod);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -389,6 +389,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.smsPhoneNumber = this.getSMSPhoneFromStore();
|
this.smsPhoneNumber = this.getSMSPhoneFromStore();
|
||||||
if (this.isPayInAdvanceDisabled) {
|
if (this.isPayInAdvanceDisabled) {
|
||||||
|
console.log('Pay in Advance is disabled, defaulting to Pay at Time of Service');
|
||||||
this.paymentMethod = paymentMethods.PAY_AT_TIME_OF_SERVICE;
|
this.paymentMethod = paymentMethods.PAY_AT_TIME_OF_SERVICE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue