import { describe, it, expect } from 'vitest';
import { render } from '@testing-library/svelte';
import NumberBadge from './NumberBadge.svelte';
describe('m-number-badge component', () => {
    it('renders the label correctly', () => {
        const { container } = render(NumberBadge, { props: { label: 42 } });
        expect(container.textContent).toContain('42');
    });
    it('applies the default appearance and size classes', () => {
        const { container } = render(NumberBadge, { props: { label: 1 } });
        const badge = container.querySelector('.mc-number-badge');
        expect(badge).toHaveClass('mc-number-badge--standard');
        expect(badge).toHaveClass('mc-number-badge--s');
    });
    it('applies custom appearance and size classes', () => {
        const { container } = render(NumberBadge, {
            props: { label: 99, appearance: 'danger', size: 'm' },
        });
        const badge = container.querySelector('.mc-number-badge');
        expect(badge).toHaveClass('mc-number-badge--danger');
        expect(badge).toHaveClass('mc-number-badge--m');
    });
    it('renders numeric label as text content', () => {
        const { container } = render(NumberBadge, { props: { label: 0 } });
        const badge = container.querySelector('.mc-number-badge');
        expect(badge?.textContent).toBe('0');
    });
});
