// Assert expect(screen.getByText(/count: 1/i)).toBeInTheDocument() }) import { waitFor, screen } from '@testing-library/react' test('loads user data', async () => { render(<UserProfile userId={123} />)
// Wait for loading to complete expect(screen.getByText(/loading/i)).toBeInTheDocument() react testing library
expect(handleSubmit).toHaveBeenCalledWith({ email: 'test@example.com', password: 'password123' }) }) import { renderHook, act } from '@testing-library/react' test('useCounter hook increments', () => { const { result } = renderHook(() => useCounter(0)) // Assert expect(screen