SSR-1485 Update Unit tests for changes
This commit is contained in:
parent
813898e8e5
commit
871226d2ad
1 changed files with 88 additions and 1 deletions
|
|
@ -93,7 +93,12 @@ describe('payment-method.vue', () => {
|
|||
payment: {
|
||||
isPayInAdvance: true,
|
||||
payInAdvanceType: payInAdvanceMethod
|
||||
}
|
||||
},
|
||||
insuranceCoverage: {
|
||||
coverageStatus: coverageStatuses.VERIFIED,
|
||||
coverageType: coverageType.Deductible
|
||||
},
|
||||
currentDeductible: 1000
|
||||
}
|
||||
};
|
||||
const wrapper = setupMocks({}, store);
|
||||
|
|
@ -101,6 +106,88 @@ describe('payment-method.vue', () => {
|
|||
// Act
|
||||
const paymethod = wrapper.vm.getPaymentMethodFromStore();
|
||||
|
||||
// Assert
|
||||
expect(paymethod).toBe(payInAdvanceMethod);
|
||||
});
|
||||
test('getting PAY_AT_TIME_OF_SERVICE when deductible is 0', async () => {
|
||||
// Arrange
|
||||
const payInAdvanceMethod = paymentMethods.PAY_AT_TIME_OF_SERVICE;
|
||||
const store = {
|
||||
order: {
|
||||
payment: {
|
||||
isPayInAdvance: true,
|
||||
payInAdvanceType: payInAdvanceMethod
|
||||
},
|
||||
insuranceCoverage: {
|
||||
coverageStatus: coverageStatuses.VERIFIED,
|
||||
coverageType: coverageType.Deductible
|
||||
},
|
||||
currentDeductible: 0
|
||||
}
|
||||
};
|
||||
const wrapper = setupMocks({}, store);
|
||||
|
||||
// Act
|
||||
const paymethod = wrapper.vm.getPaymentMethodFromStore();
|
||||
|
||||
// Assert
|
||||
expect(paymethod).toBe(payInAdvanceMethod);
|
||||
});
|
||||
test('getting PAY_AT_TIME_OF_SERVICE when Unverified', async () => {
|
||||
// Arrange
|
||||
const payInAdvanceMethod = paymentMethods.PAY_AT_TIME_OF_SERVICE;
|
||||
const store = {
|
||||
order: {
|
||||
payment: {
|
||||
isPayInAdvance: true,
|
||||
payInAdvanceType: payInAdvanceMethod
|
||||
},
|
||||
insuranceCoverage: {
|
||||
coverageStatus: coverageStatuses.PENDING,
|
||||
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 PIA Experiment disabled', async () => {
|
||||
// Arrange
|
||||
const payInAdvanceMethod = paymentMethods.PAY_AT_TIME_OF_SERVICE;
|
||||
const mixin = {
|
||||
methods: {
|
||||
getSettingValue: jest.fn((settingName) => {
|
||||
if (settingName === experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE) {
|
||||
return 'false';
|
||||
}
|
||||
return 'false';
|
||||
})
|
||||
}
|
||||
};
|
||||
const store = {
|
||||
order: {
|
||||
payment: {
|
||||
isPayInAdvance: true,
|
||||
payInAdvanceType: payInAdvanceMethod
|
||||
},
|
||||
insuranceCoverage: {
|
||||
coverageStatus: coverageStatuses.VERIFIED,
|
||||
coverageType: coverageType.Deductible
|
||||
},
|
||||
currentDeductible: 1000
|
||||
}
|
||||
};
|
||||
const wrapper = setupMocks({}, store, mixin);
|
||||
|
||||
// Act
|
||||
const paymethod = wrapper.vm.getPaymentMethodFromStore();
|
||||
|
||||
// Assert
|
||||
expect(paymethod).toBe(payInAdvanceMethod);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue