Files
mimic/frontend/tests/StatusBadge.test.tsx
Knacky 573281f454 fix(design): code-reviewer polish — dedupe tag-mitre recipe, drop dead boxShadow tokens, cover StatusBadge classes
F1: MitreTechniqueTag inline classes replaced with className="tag-mitre gap-xxs"
    (index.css .tag-mitre is now the single source of truth for technique tags).
F2: boxShadow block removed from tailwind.config.ts — no component referenced
    shadow-soft-lift / shadow-floating / *-dark; DESIGN.md §Don'ts prohibits shadows.
F4: StatusBadge.test.tsx gains 3 class assertions (bg-warn-soft / bg-primary-soft / bg-cloud)
    mirroring SimulationStatusBadge.test.tsx pattern. Test count: 136 → 139.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 05:53:53 +02:00

28 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { render, screen } from '@testing-library/react';
import { StatusBadge } from '@/components/StatusBadge';
describe('StatusBadge', () => {
it.each(['planned', 'active', 'closed'] as const)('renders %s label and data attr', (status) => {
render(<StatusBadge status={status} />);
const badge = screen.getByTestId('status-badge');
expect(badge).toHaveAttribute('data-status', status);
expect(badge.textContent?.toLowerCase()).toBe(status);
});
it('applies warn-soft surface for planned', () => {
render(<StatusBadge status="planned" />);
expect(screen.getByTestId('status-badge').className).toContain('bg-warn-soft');
});
it('applies primary-soft surface for active', () => {
render(<StatusBadge status="active" />);
expect(screen.getByTestId('status-badge').className).toContain('bg-primary-soft');
});
it('applies cloud surface for closed', () => {
render(<StatusBadge status="closed" />);
expect(screen.getByTestId('status-badge').className).toContain('bg-cloud');
});
});