import { render, screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { Label } from '../../src/components/Label';

describe('Label', () => {
    it('uses default and variant-specific tags/classes', () => {
        const { rerender } = render(<Label>Body</Label>);
        expect(screen.getByText('Body').tagName).toBe('P');
        expect(screen.getByText('Body')).toHaveClass('ui-body-primary');

        rerender(<Label variant="h1">Title</Label>);
        expect(screen.getByText('Title').tagName).toBe('H1');
        expect(screen.getByText('Title')).toHaveClass('ui-title');

        rerender(<Label variant="h4">Section</Label>);
        expect(screen.getByText('Section').tagName).toBe('H3');

        rerender(
            <Label variant="h2" as="span">
                Custom
            </Label>,
        );
        expect(screen.getByText('Custom').tagName).toBe('SPAN');
    });
});
