salix-front/test/vitest/__tests__/components/common/CrudModel.spec.js

36 lines
995 B
JavaScript
Raw Normal View History

2023-08-17 13:32:56 +00:00
import { createWrapper } from 'app/test/vitest/helper';
import CrudModel from 'components/CrudModel.vue';
import { vi, afterEach, beforeAll, describe, expect, it } from 'vitest';
describe.only('CrudModel', () => {
let vm;
beforeAll(() => {
vm = createWrapper(CrudModel, {
global: {
stubs: ['VnPaginate', 'useState'],
},
propsData: {
dataRequired: {
id: 1,
name: 'name',
autoLoad: true,
},
},
}).vm;
});
afterEach(() => {
vi.clearAllMocks();
});
describe('insert()', () => {
it('should new element in list', () => {
vm.insert();
expect(vm.message).toEqual(
`A minimum amount of 50€ (VAT excluded) is required for your order ${orderId} of ${shipped} to receive it without additional shipping costs.`
);
});
});
});