import { render, screen } from '@testing-library/react'; import { describe, expect, it } from 'vitest'; import { Label } from '../label'; describe('Label', () => { it('renders label text', () => { render(); expect(screen.getByText('Số điện thoại')).toBeInTheDocument(); }); it('associates with input via htmlFor', () => { render( <> , ); expect(screen.getByLabelText('Phone')).toBeInTheDocument(); }); it('applies custom className', () => { render(); expect(screen.getByTestId('label')).toHaveClass('custom'); }); });