36 lines
995 B
JavaScript
36 lines
995 B
JavaScript
|
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.`
|
||
|
);
|
||
|
});
|
||
|
});
|
||
|
});
|