Barazo default frontend barazo.forum
at main 27 lines 880 B view raw
1import { render, screen } from '@testing-library/react' 2import { axe } from 'vitest-axe' 3import AdminLoading from './loading' 4 5describe('AdminLoading', () => { 6 it('renders a loading status region', () => { 7 render(<AdminLoading />) 8 expect(screen.getByRole('status')).toBeInTheDocument() 9 }) 10 11 it('renders accessible loading text for screen readers', () => { 12 render(<AdminLoading />) 13 expect(screen.getByText('Loading admin dashboard')).toBeInTheDocument() 14 }) 15 16 it('renders four stat card skeletons', () => { 17 const { container } = render(<AdminLoading />) 18 const cards = container.querySelectorAll('.rounded-lg.border') 19 expect(cards.length).toBe(4) 20 }) 21 22 it('passes axe accessibility check', async () => { 23 const { container } = render(<AdminLoading />) 24 const results = await axe(container) 25 expect(results).toHaveNoViolations() 26 }) 27})