diff --git a/src/components/common/__tests__/VnDiscount.spec.js b/src/components/common/__tests__/VnDiscount.spec.js index 5d5be61ac..34c4ff630 100644 --- a/src/components/common/__tests__/VnDiscount.spec.js +++ b/src/components/common/__tests__/VnDiscount.spec.js @@ -4,7 +4,7 @@ import VnDiscount from 'components/common/vnDiscount.vue'; describe('VnDiscount', () => { let vm; - + beforeAll(() => { vm = createWrapper(VnDiscount, { props: { @@ -12,7 +12,9 @@ describe('VnDiscount', () => { price: 100, quantity: 2, discount: 10, - } + mana: 10, + promise: vi.fn(), + }, }).vm; }); @@ -21,8 +23,8 @@ describe('VnDiscount', () => { }); describe('total', () => { - it('should calculate total correctly', () => { + it('should calculate total correctly', () => { expect(vm.total).toBe(180); }); }); -}); \ No newline at end of file +}); diff --git a/src/pages/Claim/Card/ClaimPhoto.vue b/src/pages/Claim/Card/ClaimPhoto.vue index d4acc9bbe..26578a9b4 100644 --- a/src/pages/Claim/Card/ClaimPhoto.vue +++ b/src/pages/Claim/Card/ClaimPhoto.vue @@ -23,7 +23,7 @@ const claimDms = ref([ ]); const client = ref({}); const inputFile = ref(); -const files = ref({}); +const files = ref([]); const spinnerRef = ref(); const claimDmsRef = ref(); const dmsType = ref({}); @@ -252,9 +252,8 @@ function onDrag() { icon="add" color="primary" > - { let vm; @@ -12,6 +13,9 @@ describe('ClaimLines', () => { mocks: { fetch: vi.fn(), }, + directives: { + shortcut: keyShortcut, + }, }, }).vm; }); @@ -51,7 +55,7 @@ describe('ClaimLines', () => { expectedData, { signal: canceller.signal, - } + }, ); }); }); @@ -68,7 +72,7 @@ describe('ClaimLines', () => { expect.objectContaining({ message: 'Discount updated', type: 'positive', - }) + }), ); }); }); diff --git a/src/pages/Claim/Card/__tests__/ClaimLinesImport.spec.js b/src/pages/Claim/Card/__tests__/ClaimLinesImport.spec.js index d93c96132..1c4f367d4 100644 --- a/src/pages/Claim/Card/__tests__/ClaimLinesImport.spec.js +++ b/src/pages/Claim/Card/__tests__/ClaimLinesImport.spec.js @@ -1,4 +1,4 @@ -import { vi, describe, expect, it, beforeAll, beforeEach, afterEach } from 'vitest'; +import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest'; import { createWrapper, axios } from 'app/test/vitest/helper'; import ClaimLinesImport from 'pages/Claim/Card/ClaimLinesImport.vue'; @@ -13,6 +13,9 @@ describe('ClaimLinesImport', () => { fetch: vi.fn(), }, }, + propsData: { + ticketId: 1, + }, }).vm; }); @@ -39,7 +42,7 @@ describe('ClaimLinesImport', () => { expect.objectContaining({ message: 'Lines added to claim', type: 'positive', - }) + }), ); expect(vm.canceller).toEqual(null); }); diff --git a/src/pages/Claim/Card/__tests__/ClaimPhoto.spec.js b/src/pages/Claim/Card/__tests__/ClaimPhoto.spec.js index c38852af1..7139fa9e3 100644 --- a/src/pages/Claim/Card/__tests__/ClaimPhoto.spec.js +++ b/src/pages/Claim/Card/__tests__/ClaimPhoto.spec.js @@ -1,6 +1,7 @@ import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest'; import { createWrapper, axios } from 'app/test/vitest/helper'; import ClaimPhoto from 'pages/Claim/Card/ClaimPhoto.vue'; +import keyShortcut from 'src/boot/keyShortcut'; describe('ClaimPhoto', () => { let vm; @@ -25,6 +26,9 @@ describe('ClaimPhoto', () => { mocks: { fetch: vi.fn(), }, + directives: { + shortcut: keyShortcut, + }, }, }).vm; }); @@ -41,10 +45,10 @@ describe('ClaimPhoto', () => { await vm.deleteDms({ index: 0 }); expect(axios.post).toHaveBeenCalledWith( - `ClaimDms/${claimMock.claimDms[0].dmsFk}/removeFile` + `ClaimDms/${claimMock.claimDms[0].dmsFk}/removeFile`, ); expect(vm.quasar.notify).toHaveBeenCalledWith( - expect.objectContaining({ type: 'positive' }) + expect.objectContaining({ type: 'positive' }), ); }); }); @@ -61,9 +65,9 @@ describe('ClaimPhoto', () => { title: 'This file will be deleted', icon: 'delete', data: { index: 1 }, - promise: vm.deleteDms + promise: vm.deleteDms, }, - }) + }), ); }); }); @@ -102,10 +106,10 @@ describe('ClaimPhoto', () => { new FormData(), expect.objectContaining({ params: expect.objectContaining({ hasFile: false }), - }) + }), ); expect(vm.quasar.notify).toHaveBeenCalledWith( - expect.objectContaining({ type: 'positive' }) + expect.objectContaining({ type: 'positive' }), ); expect(vm.claimDmsRef.fetch).toHaveBeenCalledOnce(); diff --git a/src/pages/Customer/Payments/__tests__/CustomerPayments.spec.js b/src/pages/Customer/Payments/__tests__/CustomerPayments.spec.js index 466a544b4..bb4423ddd 100644 --- a/src/pages/Customer/Payments/__tests__/CustomerPayments.spec.js +++ b/src/pages/Customer/Payments/__tests__/CustomerPayments.spec.js @@ -1,6 +1,7 @@ import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest'; import { createWrapper, axios } from 'app/test/vitest/helper'; import CustomerPayments from 'src/pages/Customer/Payments/CustomerPayments.vue'; +import keyShortcut from 'src/boot/keyShortcut'; describe('CustomerPayments', () => { let vm; @@ -12,6 +13,9 @@ describe('CustomerPayments', () => { mocks: { fetch: vi.fn(), }, + directives: { + shortcut: keyShortcut, + }, }, }).vm; }); @@ -31,7 +35,7 @@ describe('CustomerPayments', () => { expect.objectContaining({ message: 'Payment confirmed', type: 'positive', - }) + }), ); }); });