fix unit test
This commit is contained in:
parent
436612c1c6
commit
ce2b45c4f7
1 changed files with 4 additions and 9 deletions
|
|
@ -16,7 +16,8 @@ import coverageType from '@/constants/coverage-type';
|
||||||
|
|
||||||
// Mock so it can be used as an assertion
|
// Mock so it can be used as an assertion
|
||||||
jest.mock('@/helpers/order-helper.js', () => ({
|
jest.mock('@/helpers/order-helper.js', () => ({
|
||||||
submitWorkOrder: jest.fn()
|
submitWorkOrder: jest.fn(),
|
||||||
|
saveSession: jest.fn()
|
||||||
}));
|
}));
|
||||||
|
|
||||||
function setupMocks({ customMountOptions = {}, queryString }, mainInitialState = {}, customMixin = null) {
|
function setupMocks({ customMountOptions = {}, queryString }, mainInitialState = {}, customMixin = null) {
|
||||||
|
|
@ -319,14 +320,8 @@ describe('payment-method.vue', () => {
|
||||||
describe('forwardButtonAction', () => {
|
describe('forwardButtonAction', () => {
|
||||||
test('Pay at the time of service is selected, should call saveWorkOrder', async () => {
|
test('Pay at the time of service is selected, should call saveWorkOrder', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const store = {
|
const wrapper = setupMocks({});
|
||||||
order: {
|
wrapper.vm.paymentMethod = paymentMethods.PAY_AT_TIME_OF_SERVICE;
|
||||||
payment: {
|
|
||||||
paymentMethod: paymentMethods.PAY_AT_TIME_OF_SERVICE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const wrapper = setupMocks({}, store);
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
await wrapper.vm.forwardButtonAction();
|
await wrapper.vm.forwardButtonAction();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue