From a303692454e5029510bbf937cfe624c90e7b044c Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 20 Feb 2023 15:13:53 +0100 Subject: [PATCH] test(claim_photo): init front test --- .../__tests__/pages/Claims/ClaimPhoto.spec.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/vitest/__tests__/pages/Claims/ClaimPhoto.spec.js diff --git a/test/vitest/__tests__/pages/Claims/ClaimPhoto.spec.js b/test/vitest/__tests__/pages/Claims/ClaimPhoto.spec.js new file mode 100644 index 0000000000..872add9af9 --- /dev/null +++ b/test/vitest/__tests__/pages/Claims/ClaimPhoto.spec.js @@ -0,0 +1,30 @@ +import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest'; +import { ref } from 'vue'; +import { createWrapper, axios } from 'app/test/vitest/helper'; +import ClaimPhoto from 'pages/Claim/Card/ClaimPhoto.vue'; + +describe('ClaimPhoto', () => { + let vm; + beforeAll(() => { + vm = createWrapper(ClaimPhoto).vm; + }); + + afterEach(() => { + //vi.clearAllMocks(); + }); + + describe('viewDeleteDms()', () => { + it('should call quasar dialog', async () => { + console.log(vm.quasar); + vi.spyOn(axios, 'get').mockResolvedValue(); + vi.spyOn(axios, 'post').mockResolvedValue(); + vi.spyOn(vm.quasar, 'notify'); + + // await vm.viewDeleteDms(); + + // expect(vm.quasar.notify).toHaveBeenCalledWith( + // expect.objectContaining({ type: 'positive' }) + // ); + }); + }); +});