forked from verdnatura/salix-front
refs #5357 mocking fetch
This commit is contained in:
parent
28d844ab3d
commit
6c9ca97274
|
@ -1,21 +1,23 @@
|
|||
import { vi, describe, expect, it, beforeAll, afterEach, beforeEach } from 'vitest';
|
||||
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
|
||||
import { createWrapper } from 'app/test/vitest/helper';
|
||||
import VnLog from 'src/components/common/VnLog.vue';
|
||||
|
||||
describe('VnLog', () => {
|
||||
let vm;
|
||||
beforeAll(() => {
|
||||
vm = createWrapper(VnLog, {
|
||||
global: {
|
||||
stubs: ['FetchData', 'VnPaginate'],
|
||||
mocks: {
|
||||
fetch: vi.fn(),
|
||||
},
|
||||
},
|
||||
propsData: {
|
||||
model: "Claim",
|
||||
},
|
||||
}).vm;
|
||||
});
|
||||
|
||||
beforeEach(()=>{
|
||||
vi.spyOn(axios, 'get').mockResolvedValue({ data: true });
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue