feat(frontend): i18n simulation pages (SimulationFormPage, SimulationList)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Knacky
2026-06-21 23:31:21 +02:00
parent ea870af324
commit 5b93f880a3
3 changed files with 101 additions and 96 deletions

View File

@@ -88,12 +88,12 @@ describe('SimulationFormPage — redteam mode (edit existing)', () => {
});
await waitFor(() => {
expect(screen.getByLabelText(/^Name/i)).not.toBeDisabled();
expect(screen.getByLabelText(/^Nom/i)).not.toBeDisabled();
});
expect(screen.getByLabelText(/Description/i)).not.toBeDisabled();
expect(screen.getByLabelText(/Commands/i)).not.toBeDisabled();
expect(screen.getByLabelText(/Executed at/i)).not.toBeDisabled();
expect(screen.getByLabelText(/^Description/i)).not.toBeDisabled();
expect(screen.getByLabelText(/^Commandes/i)).not.toBeDisabled();
expect(screen.getByLabelText(/^Exécuté le/i)).not.toBeDisabled();
});
it('shows "Mark for review" button when status is pending', async () => {
@@ -102,7 +102,7 @@ describe('SimulationFormPage — redteam mode (edit existing)', () => {
});
await waitFor(() => {
expect(screen.getByRole('button', { name: /Mark for review/i })).toBeInTheDocument();
expect(screen.getByTestId('mark-review-btn')).toBeInTheDocument();
});
});
@@ -111,8 +111,8 @@ describe('SimulationFormPage — redteam mode (edit existing)', () => {
routerProps: { initialEntries: ['/engagements/42/simulations/7/edit'] },
});
await waitFor(() => screen.getByRole('button', { name: /Mark for review/i }));
expect(screen.queryByRole('button', { name: /^Close$/i })).toBeNull();
await waitFor(() => screen.getByTestId('mark-review-btn'));
expect(screen.queryByTestId('close-btn')).toBeNull();
});
it('shows "Mark for review" for in_progress status', async () => {
@@ -122,7 +122,7 @@ describe('SimulationFormPage — redteam mode (edit existing)', () => {
});
await waitFor(() => {
expect(screen.getByRole('button', { name: /Mark for review/i })).toBeInTheDocument();
expect(screen.getByTestId('mark-review-btn')).toBeInTheDocument();
});
});
@@ -133,7 +133,7 @@ describe('SimulationFormPage — redteam mode (edit existing)', () => {
});
await waitFor(() => {
expect(screen.getByRole('button', { name: /^Close$/i })).toBeInTheDocument();
expect(screen.getByTestId('close-btn')).toBeInTheDocument();
});
});
@@ -143,7 +143,7 @@ describe('SimulationFormPage — redteam mode (edit existing)', () => {
});
await waitFor(() => {
expect(screen.getByRole('button', { name: /^Delete$/i })).toBeInTheDocument();
expect(screen.getByTestId('delete-btn')).toBeInTheDocument();
});
});
});
@@ -179,10 +179,10 @@ describe('SimulationFormPage — SOC role + pending (blocked)', () => {
});
await waitFor(() => {
expect(screen.getByLabelText(/Log source/i)).toBeDisabled();
expect(screen.getByLabelText(/^Source de log/i)).toBeDisabled();
});
expect(screen.getByLabelText(/Incident number/i)).toBeDisabled();
expect(screen.getByLabelText(/^Numéro d'incident/i)).toBeDisabled();
});
it('Red Team inputs are disabled for SOC', async () => {
@@ -191,10 +191,10 @@ describe('SimulationFormPage — SOC role + pending (blocked)', () => {
});
await waitFor(() => {
expect(screen.getByLabelText(/^Name/i)).toBeDisabled();
expect(screen.getByLabelText(/^Nom/i)).toBeDisabled();
});
expect(screen.getByLabelText(/Description/i)).toBeDisabled();
expect(screen.getByLabelText(/^Description/i)).toBeDisabled();
});
});
@@ -218,10 +218,10 @@ describe('SimulationFormPage — SOC role + review_required (can edit SOC fields
});
await waitFor(() => {
expect(screen.getByLabelText(/Log source/i)).not.toBeDisabled();
expect(screen.getByLabelText(/^Source de log/i)).not.toBeDisabled();
});
expect(screen.getByLabelText(/Incident number/i)).not.toBeDisabled();
expect(screen.getByLabelText(/^Numéro d'incident/i)).not.toBeDisabled();
});
it('Red Team inputs remain disabled for SOC even when review_required', async () => {
@@ -230,7 +230,7 @@ describe('SimulationFormPage — SOC role + review_required (can edit SOC fields
});
await waitFor(() => {
expect(screen.getByLabelText(/^Name/i)).toBeDisabled();
expect(screen.getByLabelText(/^Nom/i)).toBeDisabled();
});
});
@@ -240,7 +240,7 @@ describe('SimulationFormPage — SOC role + review_required (can edit SOC fields
});
await waitFor(() => {
expect(screen.getByLabelText(/Log source/i)).not.toBeDisabled();
expect(screen.getByLabelText(/^Source de log/i)).not.toBeDisabled();
});
expect(screen.queryByTestId('soc-blocked-banner')).toBeNull();
@@ -252,7 +252,7 @@ describe('SimulationFormPage — SOC role + review_required (can edit SOC fields
});
await waitFor(() => {
expect(screen.getByRole('button', { name: /^Close$/i })).toBeInTheDocument();
expect(screen.getByTestId('close-btn')).toBeInTheDocument();
});
});
});
@@ -273,8 +273,8 @@ describe('SimulationFormPage — new simulation', () => {
renderWithProviders(<NewPage />, {
routerProps: { initialEntries: ['/engagements/42/simulations/new'] },
});
expect(screen.getByLabelText(/^Name/i)).toBeInTheDocument();
expect(screen.getByRole('button', { name: /Create simulation/i })).toBeInTheDocument();
expect(screen.getByLabelText(/^Nom/i)).toBeInTheDocument();
expect(screen.getByTestId('create-sim-btn')).toBeInTheDocument();
});
});
@@ -311,7 +311,7 @@ describe('SimulationFormPage — Execute via C2 button visibility', () => {
routerProps: { initialEntries: ['/engagements/42/simulations/7/edit'] },
});
await waitFor(() => {
expect(screen.getByLabelText(/^Name/i)).not.toBeDisabled();
expect(screen.getByLabelText(/^Nom/i)).not.toBeDisabled();
});
expect(screen.queryByTestId('c2-execute-btn')).toBeNull();
});
@@ -369,7 +369,7 @@ describe('SimulationFormPage — C2 tasks panel visibility', () => {
});
// Wait for page data to load then confirm no panel
await waitFor(() => {
expect(screen.getByLabelText(/^Name/i)).not.toBeDisabled();
expect(screen.getByLabelText(/^Nom/i)).not.toBeDisabled();
});
expect(screen.queryByTestId('c2-tasks-panel')).toBeNull();
});