Barazo default frontend
barazo.forum
1import { render, screen } from '@testing-library/react'
2import { axe } from 'vitest-axe'
3import RootLoading from './loading'
4
5describe('RootLoading', () => {
6 it('renders a loading status region', () => {
7 render(<RootLoading />)
8 expect(screen.getByRole('status')).toBeInTheDocument()
9 })
10
11 it('renders accessible loading text for screen readers', () => {
12 render(<RootLoading />)
13 expect(screen.getByText('Loading forum content')).toBeInTheDocument()
14 })
15
16 it('renders skeleton placeholders', () => {
17 const { container } = render(<RootLoading />)
18 const skeletons = container.querySelectorAll('.animate-pulse')
19 expect(skeletons.length).toBeGreaterThan(0)
20 })
21
22 it('passes axe accessibility check', async () => {
23 const { container } = render(<RootLoading />)
24 const results = await axe(container)
25 expect(results).toHaveNoViolations()
26 })
27})