#7068: Created VnVisibleColumns test #1250

Merged
jon merged 7 commits from 7068-TableVisibleColumnsTest into dev 2025-01-21 12:11:45 +00:00
1 changed files with 5 additions and 3 deletions
Showing only changes of commit b36c53119c - Show all commits

View File

@ -1,4 +1,4 @@
import { describe, expect, it, beforeEach, vi } from 'vitest';
import { describe, expect, it, beforeEach, afterEach, vi } from 'vitest';
import { createWrapper } from 'app/test/vitest/helper';
import VnVisibleColumn from '../VnVisibleColumn.vue';
import { axios } from 'app/test/vitest/helper';
@ -17,6 +17,10 @@ describe('VnVisibleColumns', () => {
vm = wrapper.vm;
});
afterEach(() => {
vi.clearAllMocks();
});
describe('setUserConfigViewData()', () => {
it('should initialize localColumns with visible configuration', () => {
columnsMock = [
@ -112,8 +116,6 @@ describe('VnVisibleColumns', () => {
},
Review

Está bien y aunque solo hay 1 es correcto
Pero todavia mejor si lo metemos dentro de un afterEach y usamo vi.clearAllMocks();

afterEach(() => { vi.clearAllMocks(); });

Estariamos usando el standard en todos los tests

Está bien y aunque solo hay 1 es correcto Pero todavia mejor si lo metemos dentro de un afterEach y usamo vi.clearAllMocks(); ` afterEach(() => { vi.clearAllMocks(); });` Estariamos usando el standard en todos los tests
],
});
mockAxiosPost.mockRestore();
});
});
});