import { describe, it, expect } from 'vitest';
import { render } from '@testing-library/svelte';
import LinearProgressbarBuffer from './LinearProgressbarBuffer.svelte';
describe('m-linear-progressbar-buffer component', () => {
    it('renders with default size and value', () => {
        const { container } = render(LinearProgressbarBuffer);
        const wrapper = container.querySelector('.mc-linear-progressbar-buffer');
        expect(wrapper).toBeTruthy();
        expect(wrapper?.classList.contains('mc-linear-progressbar-buffer--m')).toBe(true);
        const indicator = container.querySelector('.mc-linear-progressbar-buffer__indicator');
        expect(indicator).toBeTruthy();
        expect(indicator.style.getPropertyValue('--progress-value')).toBe('0');
        expect(indicator.getAttribute('aria-valuenow')).toBe('0');
    });
    it('applies custom size and value correctly', () => {
        const { container } = render(LinearProgressbarBuffer, {
            props: {
                size: 'l',
                value: 75,
            },
        });
        const wrapper = container.querySelector('.mc-linear-progressbar-buffer');
        expect(wrapper?.classList.contains('mc-linear-progressbar-buffer--l')).toBe(true);
        const indicator = container.querySelector('.mc-linear-progressbar-buffer__indicator');
        expect(indicator.style.getPropertyValue('--progress-value')).toBe('75');
        expect(indicator.getAttribute('aria-valuenow')).toBe('75');
    });
});
