diff --git a/test/vitest/__tests__/App.spec.js b/test/vitest/__tests__/App.spec.js index 5013ca0b8..b5e888a94 100644 --- a/test/vitest/__tests__/App.spec.js +++ b/test/vitest/__tests__/App.spec.js @@ -34,10 +34,17 @@ describe('App', () => { const response = { response: { status: 401, + data: { + error: { + message: 'Invalid username or password', + }, + }, }, }; - expect(vm.responseError(response)).rejects.toEqual(expect.objectContaining(response)); + expect(vm.responseError(response)).rejects.toEqual( + expect.objectContaining(response) + ); expect(vm.quasar.notify).toHaveBeenCalledWith( expect.objectContaining({ message: 'Invalid username or password', @@ -54,10 +61,17 @@ describe('App', () => { const response = { response: { status: 401, + data: { + error: { + message: 'Access denied', + }, + }, }, }; - expect(vm.responseError(response)).rejects.toEqual(expect.objectContaining(response)); + expect(vm.responseError(response)).rejects.toEqual( + expect.objectContaining(response) + ); expect(vm.quasar.notify).toHaveBeenCalledWith( expect.objectContaining({ message: 'Access denied', diff --git a/test/vitest/__tests__/pages/Claims/ClaimDescriptorMenu.spec.js b/test/vitest/__tests__/pages/Claims/ClaimDescriptorMenu.spec.js index a1c3a38ed..b208f1704 100644 --- a/test/vitest/__tests__/pages/Claims/ClaimDescriptorMenu.spec.js +++ b/test/vitest/__tests__/pages/Claims/ClaimDescriptorMenu.spec.js @@ -18,12 +18,12 @@ describe('ClaimDescriptorMenu', () => { vi.clearAllMocks(); }); - describe('deleteClaim()', () => { + describe('remove()', () => { it('should delete the claim', async () => { vi.spyOn(axios, 'delete').mockResolvedValue({ data: true }); vi.spyOn(vm.quasar, 'notify'); - await vm.deleteClaim(); + await vm.remove(); expect(vm.quasar.notify).toHaveBeenCalledWith( expect.objectContaining({ type: 'positive' }) diff --git a/test/vitest/__tests__/pages/Claims/ClaimPhoto.spec.js b/test/vitest/__tests__/pages/Claims/ClaimPhoto.spec.js index 21c7865eb..c38852af1 100644 --- a/test/vitest/__tests__/pages/Claims/ClaimPhoto.spec.js +++ b/test/vitest/__tests__/pages/Claims/ClaimPhoto.spec.js @@ -21,7 +21,7 @@ describe('ClaimPhoto', () => { beforeAll(() => { vm = createWrapper(ClaimPhoto, { global: { - stubs: ['FetchData', 'TeleportSlot', 'vue-i18n'], + stubs: ['FetchData', 'vue-i18n'], mocks: { fetch: vi.fn(), }, @@ -38,7 +38,7 @@ describe('ClaimPhoto', () => { vi.spyOn(axios, 'post').mockResolvedValue({ data: true }); vi.spyOn(vm.quasar, 'notify'); - await vm.deleteDms(0); + await vm.deleteDms({ index: 0 }); expect(axios.post).toHaveBeenCalledWith( `ClaimDms/${claimMock.claimDms[0].dmsFk}/removeFile` @@ -46,7 +46,6 @@ describe('ClaimPhoto', () => { expect(vm.quasar.notify).toHaveBeenCalledWith( expect.objectContaining({ type: 'positive' }) ); - expect(vm.claimDms).toEqual([]); }); }); @@ -59,8 +58,10 @@ describe('ClaimPhoto', () => { expect(vm.quasar.dialog).toHaveBeenCalledWith( expect.objectContaining({ componentProps: { - message: 'This file will be deleted', + title: 'This file will be deleted', icon: 'delete', + data: { index: 1 }, + promise: vm.deleteDms }, }) );