import { describe, it, expect } from 'vitest';
import { render } from '@testing-library/svelte';
import StatusBadge from './StatusBadge.svelte';
describe('m-status-badge component', () => {
    it('renders with required label and default status "info"', () => {
        const { container, getByText } = render(StatusBadge, {
            props: { label: 'Test Label' },
        });
        const badge = container.querySelector('.mc-status-badge');
        expect(badge).toBeTruthy();
        expect(badge?.classList.contains('mc-status-badge--info')).toBe(true);
        expect(getByText('Test Label')).toBeTruthy();
        const statusDot = container.querySelector('.mc-status-dot');
        expect(statusDot).toBeTruthy();
        expect(statusDot?.classList.contains('mc-status-dot--info')).toBe(true);
    });
    it('applies correct status class when status prop is set', () => {
        const { container } = render(StatusBadge, {
            props: { label: 'Status Test', status: 'error' },
        });
        const badge = container.querySelector('.mc-status-badge');
        expect(badge?.classList.contains('mc-status-badge--error')).toBe(true);
        const statusDot = container.querySelector('.mc-status-dot');
        expect(statusDot?.classList.contains('mc-status-dot--error')).toBe(true);
    });
    it('renders the label text properly', () => {
        const testLabel = 'Dynamic Label';
        const { getByText } = render(StatusBadge, { props: { label: testLabel } });
        expect(getByText(testLabel)).toBeTruthy();
    });
});
