Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AWxyMibCuGGtSQSqfajDQ7
17 lines
589 B
TypeScript
17 lines
589 B
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { render, screen } from '@testing-library/react'
|
|
import { StatCard } from '@/components/dashboard/stat-card'
|
|
|
|
describe('StatCard', () => {
|
|
it('renders label and value', () => {
|
|
render(<StatCard label="Total Incidents" value={42} />)
|
|
expect(screen.getByText('Total Incidents')).toBeTruthy()
|
|
expect(screen.getByText('42')).toBeTruthy()
|
|
})
|
|
|
|
it('renders optional sub text', () => {
|
|
render(<StatCard label="Open" value={12} sub="awaiting action" />)
|
|
expect(screen.getByText('awaiting action')).toBeTruthy()
|
|
})
|
|
})
|