mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-08-03 05:15:24 +00:00
- one gate (motionEnabled): off under reduced-motion, missing matchMedia, and vitest; every path checks it first - mount/filter-change only: count-up and bar grow-in key off the period|provider|range key, so 30s poll refreshes snap values silently instead of re-animating - first-load skeleton shimmer replaces bare scanning text (kept sr-only for screen readers); slide-in toast host for Settings/export feedback (validation errors stay inline); CSS hover-lift + press micro- interactions, all with a reduced-motion escape hatch - gsap 3.15.0 + @gsap/react 2.1.2 (+74KB raw JS; G4 flame work shares it) 244/244, typecheck + build green.
18 lines
699 B
TypeScript
18 lines
699 B
TypeScript
// @vitest-environment jsdom
|
|
import { render, screen } from '@testing-library/react'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
import { SectionSkeleton } from './Skeleton'
|
|
|
|
describe('SectionSkeleton', () => {
|
|
it('renders shimmer blocks and keeps the loading label for screen readers', () => {
|
|
const { container } = render(<SectionSkeleton label="Scanning spend…" rows={4} chart />)
|
|
|
|
expect(container.querySelectorAll('.skel').length).toBeGreaterThan(0)
|
|
expect(container.querySelector('.skel-chart')).toBeInTheDocument()
|
|
|
|
const label = screen.getByText('Scanning spend…')
|
|
expect(label).toHaveClass('sr-only')
|
|
expect(label).toHaveAttribute('role', 'status')
|
|
})
|
|
})
|