Skip to content

Commit e5032f5

Browse files
fix: reparar el test de ListItem.test.tsx
1 parent b2603f6 commit e5032f5

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

client/src/features/lists/tests/ListItem.test.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { describe, it, expect, vi, beforeEach } from 'vitest';
22
import { render, screen, fireEvent } from '@testing-library/react';
33
import userEvent from '@testing-library/user-event';
4-
import { useTaskStore } from '@/features/tasks/store/taskStore';
54
import ListItem from '@/features/lists/components/ListItem';
65
import { ListProps } from '@shared/types/list.types';
76
import { TaskProps } from '@shared/types/task.types';
@@ -19,9 +18,11 @@ const mockList: ListProps = {
1918
tasks: mockTasks,
2019
};
2120

22-
// Mock para el store de tareas
23-
vi.mock('@/features/tasks/store/taskStore', () => ({
24-
useTaskStore: vi.fn(),
21+
// Mock para react-query
22+
vi.mock('@tanstack/react-query', () => ({
23+
useQueryClient: vi.fn(() => ({
24+
getQueryData: vi.fn(() => mockTasks),
25+
})),
2526
}));
2627

2728
// Mock para react-router
@@ -41,11 +42,6 @@ vi.mock('@/shared/store/dialogStore', () => ({
4142
})),
4243
}));
4344

44-
// Mock para las utilidades de listas
45-
vi.mock('@/features/lists/utils/getTaskCount', () => ({
46-
getTaskCount: vi.fn(() => 2),
47-
}));
48-
4945
// Mock para lucide-react
5046
vi.mock('lucide-react', () => ({
5147
Trash2: vi.fn(({ className, ...props }) => (
@@ -109,10 +105,6 @@ vi.mock('@/features/lists/hooks/useLists', () => ({
109105
})),
110106
}));
111107

112-
vi.mocked(useTaskStore).mockReturnValue({
113-
tasks: mockTasks,
114-
});
115-
116108
vi.mocked(useNavigate).mockReturnValue(vi.fn());
117109

118110
describe('ListItem', () => {

0 commit comments

Comments
 (0)