import { describe, it, expect } from 'vitest';
import { render } from '@testing-library/svelte';
import Overlay from './Overlay.svelte';
describe('m-overlay component', () => {
    it('applies is-visible class when isvisible is true', () => {
        const { container } = render(Overlay, {
            props: {
                isvisible: true,
                dialoglabel: 'test-dialog-label',
            },
        });
        const overlay = container.querySelector('.mc-overlay');
        expect(overlay).toBeTruthy();
        expect(overlay).toHaveClass('is-visible');
        const dialog = container.querySelector('[role="dialog"]');
        expect(dialog).toBeTruthy();
        expect(dialog).toHaveAttribute('aria-labelledby', 'test-dialog-label');
    });
    it('does not apply is-visible class when isvisible is false or undefined', () => {
        const { container } = render(Overlay, {
            props: {
                dialoglabel: 'test-dialog-label',
            },
        });
        const overlay = container.querySelector('.mc-overlay');
        expect(overlay).toBeTruthy();
        expect(overlay).not.toHaveClass('is-visible');
    });
});
