import { describe, it, expect } from 'vitest';
import { render } from '@testing-library/svelte';
import Tooltip from './Tooltip.svelte';
describe('m-tooltip component', () => {
    it('renders with default props and displays text', () => {
        const { container } = render(Tooltip, {
            props: {
                id: 'tooltip-id',
                text: 'This is a tooltip',
            },
        });
        const tooltip = container.querySelector('.mc-tooltip');
        expect(tooltip).toBeTruthy();
        expect(tooltip.classList.contains('mc-tooltip--top')).toBe(true);
    });
    it('applies the correct position class', () => {
        const { container } = render(Tooltip, {
            props: {
                id: 'tooltip-id',
                text: 'Tooltip content',
                position: 'bottom',
            },
        });
        const tooltip = container.querySelector('.mc-tooltip');
        expect(tooltip.classList.contains('mc-tooltip--bottom')).toBe(true);
    });
    it('hides pointer when pointer prop is false', () => {
        const { container } = render(Tooltip, {
            props: {
                id: 'tooltip-id',
                text: 'Tooltip content',
                pointer: false,
            },
        });
        const tooltip = container.querySelector('.mc-tooltip');
        expect(tooltip.classList.contains('mc-tooltip--no-pointer')).toBe(true);
    });
});
