0
0
Fork 0

test(VnPaginate) fix

This commit is contained in:
Alex Moreno 2024-03-18 15:02:50 +01:00
parent e4cbaf303e
commit 9094ae8c88
1 changed files with 7 additions and 5 deletions

View File

@ -2,7 +2,7 @@ import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
import { createWrapper, axios } from 'app/test/vitest/helper';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
describe.skip('VnPaginate', () => {
describe('VnPaginate', () => {
const expectedUrl = '/api/customers';
let vm;
@ -49,6 +49,8 @@ describe.skip('VnPaginate', () => {
],
});
vm.arrayData.hasMoreData.value = true;
await vm.$nextTick();
vm.store.data = [
{ id: 1, name: 'Tony Stark' },
{ id: 2, name: 'Jessica Jones' },
@ -57,13 +59,13 @@ describe.skip('VnPaginate', () => {
await vm.paginate();
expect(vm.store.skip).toEqual(6);
expect(vm.store.data.length).toEqual(9);
expect(vm.store.skip).toEqual(3);
expect(vm.store.data.length).toEqual(6);
await vm.paginate();
expect(vm.store.skip).toEqual(9);
expect(vm.store.data.length).toEqual(12);
expect(vm.store.skip).toEqual(6);
expect(vm.store.data.length).toEqual(9);
});
});