7336_devToTest #354

Merged
alexm merged 359 commits from 7336_devToTest into test 2024-05-07 06:34:00 +00:00
1 changed files with 8 additions and 11 deletions
Showing only changes of commit 7875df4b02 - Show all commits

View File

@ -5,7 +5,6 @@ import ClaimLinesImport from 'pages/Claim/Card/ClaimLinesImport.vue';
describe('ClaimLinesImport', () => { describe('ClaimLinesImport', () => {
let vm; let vm;
beforeAll(() => { beforeAll(() => {
vm = createWrapper(ClaimLinesImport, { vm = createWrapper(ClaimLinesImport, {
global: { global: {
@ -13,7 +12,7 @@ describe('ClaimLinesImport', () => {
mocks: { mocks: {
fetch: vi.fn(), fetch: vi.fn(),
}, },
} },
}).vm; }).vm;
}); });
@ -26,25 +25,23 @@ describe('ClaimLinesImport', () => {
vi.spyOn(axios, 'post').mockResolvedValue({ data: true }); vi.spyOn(axios, 'post').mockResolvedValue({ data: true });
vi.spyOn(vm.quasar, 'notify'); vi.spyOn(vm.quasar, 'notify');
vm.selected = [ vm.selected = [{ id: 1, saleFk: 1, claimFk: 1 }];
{ id: 1, saleFk: 1, claimFk: 1, quantity: 10 }
]
vm.route.params.id = 1 vm.route.params.id = 1;
await vm.importLines(); await vm.importLines();
const expectedData = [{ saleFk: 1, claimFk: 1, quantity: 10 }] const expectedData = [{ saleFk: 1, claimFk: 1 }];
expect(axios.post).toHaveBeenCalledWith('ClaimBeginnings', expectedData, { expect(axios.post).toHaveBeenCalledWith('ClaimBeginnings', expectedData, {
signal: expect.any(Object) signal: expect.any(Object),
}) });
expect(vm.quasar.notify).toHaveBeenCalledWith( expect(vm.quasar.notify).toHaveBeenCalledWith(
expect.objectContaining({ expect.objectContaining({
message: 'Lines added to claim', message: 'Lines added to claim',
type: 'positive' type: 'positive',
}) })
); );
expect(vm.canceller).toEqual(null) expect(vm.canceller).toEqual(null);
}); });
}); });
}); });