import React from 'react'; import { afterEach, describe, expect, it, vi } from 'vitest'; 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(); const paramsState: { slug?: string } = {}; vi.mock('react-router-dom', () => ({ useNavigate: () => navigateMock, useParams: () => paramsState, })); vi.mock('@tanstack/react-query', () => ({ useQueryClient: () => ({ invalidateQueries: invalidateQueriesMock, }), })); vi.mock('../hooks/useBackNavigation', () => ({ useBackNavigation: () => backMock, })); vi.mock('../../api', () => ({ createEvent: vi.fn(), getEvent: vi.fn(), updateEvent: vi.fn(), getEventTypes: vi.fn().mockResolvedValue([]), getPackages: vi.fn().mockResolvedValue([]), trackOnboarding: vi.fn(), })); vi.mock('react-hot-toast', () => ({ default: { error: vi.fn(), success: vi.fn(), }, })); vi.mock('../components/MobileShell', () => ({ MobileShell: ({ children }: { children: React.ReactNode }) =>
{children}
, })); vi.mock('../components/Primitives', () => ({ MobileCard: ({ children }: { children: React.ReactNode }) =>
{children}
, CTAButton: ({ label, onPress }: { label: string; onPress?: () => void }) => ( ), FloatingActionButton: ({ label, onPress }: { label: string; onPress?: () => void }) => ( ), })); vi.mock('../components/FormControls', () => ({ MobileField: ({ children }: { children: React.ReactNode }) =>
{children}
, MobileDateInput: (props: React.InputHTMLAttributes) => ( ), MobileInput: (props: React.InputHTMLAttributes) => , MobileSelect: ({ children, ...props }: { children: React.ReactNode }) => , MobileTextArea: (props: React.TextareaHTMLAttributes) =>