import { describe, it, expect, beforeEach, jest } from '@jest/globals'; import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; import { GlassCard } from './glass-card'; describe('GlassCard', () => { beforeEach(() => { jest.clearAllMocks(); }); describe('Rendering', () => { it('should render glass card', () => { const { container } = render(Test Content); expect(container.firstChild).toBeInTheDocument(); }); it('should render children', () => { render(Test Content); expect(screen.getByText('Test Content')).toBeInTheDocument(); }); it('should apply custom className', () => { const { container } = render(Test); expect(container.firstChild).toHaveClass('custom-class'); }); }); describe('Variants', () => { it('should render default variant', () => { const { container } = render(Test); expect(container.firstChild).toBeInTheDocument(); }); it('should render elevated variant', () => { const { container } = render(Test); expect(container.firstChild).toBeInTheDocument(); }); it('should render outline variant', () => { const { container } = render(Test); expect(container.firstChild).toBeInTheDocument(); }); it('should render glow variant', () => { const { container } = render(Test); expect(container.firstChild).toBeInTheDocument(); }); }); describe('Styling', () => { it('should have rounded class', () => { const { container } = render(Test); expect(container.firstChild).toHaveClass('rounded-2xl'); }); it('should have border class', () => { const { container } = render(Test); expect(container.firstChild).toHaveClass('border'); }); it('should have backdrop-blur class', () => { const { container } = render(Test); expect(container.firstChild).toHaveClass('backdrop-blur-xl'); }); }); describe('Forward Ref', () => { it('should forward ref', () => { const ref = { current: null }; render(Test); expect(ref.current).toBeInstanceOf(HTMLDivElement); }); }); });