fix(frontend): translate status badge labels via i18n helpers

StatusBadge and SimulationStatusBadge now call engagementStatusLabel() /
simulationStatusLabel() from @/i18n/status.ts instead of hardcoded English
strings. Tests updated to expect French labels (Planifié/Actif/Clôturé,
En attente/En cours/Révision requise/Terminé).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Knacky
2026-06-22 00:08:45 +02:00
parent 2931e4aaf9
commit 6648d1cc2e
4 changed files with 15 additions and 20 deletions

View File

@@ -2,12 +2,18 @@ import { describe, expect, it } from 'vitest';
import { render, screen } from '@testing-library/react';
import { StatusBadge } from '@/components/StatusBadge';
const LABELS: Record<string, string> = {
planned: 'Planifié',
active: 'Actif',
closed: 'Clôturé',
};
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);
expect(badge.textContent).toBe(LABELS[status]);
});
it('applies warn-soft surface for planned', () => {