/** * AdminDashboardLayout Component Tests * * Tests for the AdminDashboardLayout component that provides a consistent * container layout for admin pages. */ import React from 'react'; import { render, screen } from '@testing-library/react'; import { AdminDashboardLayout } from './AdminDashboardLayout'; import { describe, it, expect } from 'vitest'; describe('AdminDashboardLayout', () => { it('should render children content', () => { render(
Dashboard Content
); expect(screen.getByTestId('content')).toBeTruthy(); expect(screen.getByText('Dashboard Content')).toBeTruthy(); }); it('should render multiple children', () => { render(
Section 1
Section 2
Section 3
); expect(screen.getByText('Section 1')).toBeTruthy(); expect(screen.getByText('Section 2')).toBeTruthy(); expect(screen.getByText('Section 3')).toBeTruthy(); }); it('should render with complex nested components', () => { const ComplexComponent = () => (

Complex Section

With multiple elements

); render( ); expect(screen.getByText('Complex Section')).toBeTruthy(); expect(screen.getByText('With multiple elements')).toBeTruthy(); expect(screen.getByText('Action')).toBeTruthy(); }); it('should render empty layout gracefully', () => { render(); // Should render without errors even with no children expect(document.body).toBeInTheDocument(); }); it('should render with mixed content types', () => { render(
Text content
Span content
); expect(screen.getByText('Text content')).toBeInTheDocument(); expect(screen.getByText('Span content')).toBeInTheDocument(); expect(screen.getByText('Button')).toBeInTheDocument(); expect(screen.getByPlaceholderText('Input')).toBeInTheDocument(); }); });