import { describe, it, expect } from 'vitest'; import { render, screen } from '@testing-library/react'; import { KpiCard } from '@/components/KpiCard'; describe('KpiCard', () => { it('renders the label text', () => { render(); expect(screen.getByText('Total Errors')).toBeInTheDocument(); }); it('renders the numeric value', () => { render(); expect(screen.getByText('7')).toBeInTheDocument(); }); it('applies the correct border variant class', () => { const { container } = render(); expect(container.querySelector('.border-success')).not.toBeNull(); }); it('applies the correct text variant class', () => { render(); const valueEl = screen.getByText('3'); expect(valueEl.className).toContain('text-dark'); }); it('renders value zero', () => { render(); expect(screen.getByText('0')).toBeInTheDocument(); }); it('renders large numbers', () => { render(); expect(screen.getByText('99999')).toBeInTheDocument(); }); it('applies card and col wrapper classes', () => { const { container } = render(); expect(container.querySelector('.card')).not.toBeNull(); expect(container.querySelector('.card-body')).not.toBeNull(); }); });