import { render, screen, waitFor } from '@testing-library/react';
import { describe, it, expect, vi } from 'vitest';
import { Toaster } from './sonner';
import { toast } from 'sonner';
import React from 'react';

describe('Toaster', () => {
  it('renders correctly without crashing', () => {
    render(<Toaster />);
    // Toaster renders into a portal, but we can verify it doesn't throw
    expect(true).toBe(true);
  });

  it('detects theme without crashing', () => {
    document.documentElement.classList.add('dark');
    render(<Toaster />);
    expect(document.documentElement.classList.contains('dark')).toBe(true);
    document.documentElement.classList.remove('dark');
  });

  it('calls toast without crashing', () => {
    expect(() => toast('Test message')).not.toThrow();
  });
});
