mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 07:26:30 +00:00
27 lines
976 B
TypeScript
27 lines
976 B
TypeScript
// FE-ADMSTAT-001 to FE-ADMSTAT-003
|
|
import { Users } from 'lucide-react';
|
|
import { describe, expect, it } from 'vitest';
|
|
import { render, screen } from '../../../tests/helpers/render';
|
|
import AdminStatCard from './AdminStatCard';
|
|
|
|
describe('AdminStatCard', () => {
|
|
it('FE-ADMSTAT-001: renders label and value', () => {
|
|
render(<AdminStatCard label="Users" value={42} icon={Users} />);
|
|
|
|
expect(screen.getByText('42')).toBeInTheDocument();
|
|
expect(screen.getByText('Users')).toBeInTheDocument();
|
|
});
|
|
|
|
it('FE-ADMSTAT-002: renders zero without animating away from it', () => {
|
|
render(<AdminStatCard label="Files" value={0} icon={Users} />);
|
|
|
|
expect(screen.getByText('0')).toBeInTheDocument();
|
|
});
|
|
|
|
it('FE-ADMSTAT-003: renders the passed icon component in the card', () => {
|
|
const { container } = render(<AdminStatCard label="Trips" value={7} icon={Users} />);
|
|
|
|
expect(container.querySelector('svg.lucide-users')).toBeInTheDocument();
|
|
});
|
|
});
|