Refresh event list after create
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-16 14:25:52 +01:00
parent 30c653913d
commit 9a4ece33bf
2 changed files with 26 additions and 0 deletions

View File

@@ -4,12 +4,21 @@ import { act, fireEvent, render, screen } from '@testing-library/react';
const backMock = vi.fn();
const navigateMock = vi.fn();
const selectEventMock = vi.fn();
const refetchMock = vi.fn();
const invalidateQueriesMock = vi.fn();
vi.mock('react-router-dom', () => ({
useNavigate: () => navigateMock,
useParams: () => ({}),
}));
vi.mock('@tanstack/react-query', () => ({
useQueryClient: () => ({
invalidateQueries: invalidateQueriesMock,
}),
}));
vi.mock('../hooks/useBackNavigation', () => ({
useBackNavigation: () => backMock,
}));
@@ -92,6 +101,13 @@ vi.mock('../../auth/context', () => ({
useAuth: () => ({ user: { role: 'tenant_admin' } }),
}));
vi.mock('../../context/EventContext', () => ({
useEventContext: () => ({
selectEvent: selectEventMock,
refetch: refetchMock,
}),
}));
import { getEventTypes } from '../../api';
import MobileEventFormPage from '../EventFormPage';