import { describe, it, expect } from 'vitest';
import { render } from '@testing-library/svelte';
import Divider from './Divider.svelte';
describe('m-divider component', () => {
    it('renders with default classes', () => {
        const { container } = render(Divider, {
            props: {},
        });
        const wrapper = container.querySelector('.mc-divider');
        const divider = wrapper.querySelector('div');
        expect(wrapper).toBeTruthy();
        expect(divider).toBeTruthy();
        expect(divider.classList.contains('mc-divider-horizontal--primary')).toBe(true);
        expect(divider.classList.contains('mc-divider-horizontal--s')).toBe(true);
        expect(divider.classList.contains('mc-divider-vertical')).toBe(false);
    });
    it('applies correct classes for vertical orientation', () => {
        const { container } = render(Divider, {
            props: {
                orientation: 'vertical',
            },
        });
        const divider = container.querySelector('.mc-divider > div');
        expect(divider.classList.contains('mc-divider-vertical')).toBe(true);
    });
    it('applies correct classes for appearance and size props', () => {
        const { container } = render(Divider, {
            props: {
                appearance: 'secondary',
                size: 'l',
            },
        });
        const divider = container.querySelector('.mc-divider > div');
        expect(divider.classList.contains('mc-divider-horizontal--secondary')).toBe(true);
        expect(divider.classList.contains('mc-divider-horizontal--l')).toBe(true);
    });
    it('combines all prop-driven classes correctly', () => {
        const { container } = render(Divider, {
            props: {
                orientation: 'vertical',
                appearance: 'tertiary',
                size: 'm',
            },
        });
        const divider = container.querySelector('.mc-divider > div');
        expect(divider.classList.contains('mc-divider-vertical')).toBe(true);
        expect(divider.classList.contains('mc-divider-horizontal--tertiary')).toBe(true);
        expect(divider.classList.contains('mc-divider-horizontal--m')).toBe(true);
    });
});
