import { render, screen } from '@testing-library/react'; import { describe, expect, it, vi } from 'vitest'; import { NotificationsProvider } from '../notifications-provider'; const useSocketNotificationsMock = vi.fn(); vi.mock('@/lib/hooks/use-socket-notifications', () => ({ useSocketNotifications: () => useSocketNotificationsMock(), })); describe('NotificationsProvider', () => { it('renders children', () => { render(
child
, ); expect(screen.getByText('child')).toBeInTheDocument(); }); it('initializes socket notifications hook on mount', () => { useSocketNotificationsMock.mockClear(); render( x , ); expect(useSocketNotificationsMock).toHaveBeenCalled(); }); });