feat(frontend): i18n C2 components (config card, tasks panel, execute/import modals, picker)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,7 +57,7 @@ describe('C2ConfigCard — with config (has_token=true)', () => {
|
||||
it('shows Replace token affordance when has_token=true', async () => {
|
||||
renderWithProviders(<C2ConfigCard engagementId={1} />);
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('Replace token')).toBeInTheDocument();
|
||||
expect(screen.getByText('Remplacer le token')).toBeInTheDocument();
|
||||
});
|
||||
// Token input shows placeholder bullets (readOnly)
|
||||
const tokenInput = screen.getByTestId('c2-token-input') as HTMLInputElement;
|
||||
@@ -75,9 +75,9 @@ describe('C2ConfigCard — with config (has_token=true)', () => {
|
||||
it('clicking Replace token makes input editable', async () => {
|
||||
renderWithProviders(<C2ConfigCard engagementId={1} />);
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('Replace token')).toBeInTheDocument();
|
||||
expect(screen.getByText('Remplacer le token')).toBeInTheDocument();
|
||||
});
|
||||
fireEvent.click(screen.getByText('Replace token'));
|
||||
fireEvent.click(screen.getByText('Remplacer le token'));
|
||||
await waitFor(() => {
|
||||
const tokenInput = screen.getByTestId('c2-token-input') as HTMLInputElement;
|
||||
expect(tokenInput.readOnly).toBeFalsy();
|
||||
@@ -99,7 +99,7 @@ describe('C2ConfigCard — with config (has_token=true)', () => {
|
||||
});
|
||||
fireEvent.click(screen.getByTestId('c2-test-btn'));
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('Connected')).toBeInTheDocument();
|
||||
expect(screen.getByText('Connecté')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -124,7 +124,7 @@ describe('C2ConfigCard — 503 disabled state', () => {
|
||||
renderWithProviders(<C2ConfigCard engagementId={1} />);
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
screen.getByText(/C2 features are disabled/i),
|
||||
screen.getByText(/fonctionnalités C2 sont désactivées/i),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
expect(screen.getByTestId('c2-save-btn')).toBeDisabled();
|
||||
|
||||
@@ -66,7 +66,7 @@ describe('C2TasksPanel — empty state', () => {
|
||||
await waitFor(() => {
|
||||
expect(screen.getByTestId('c2-tasks-panel')).toBeInTheDocument();
|
||||
});
|
||||
expect(screen.getByText(/No C2 tasks yet/i)).toBeInTheDocument();
|
||||
expect(screen.getByText(/Aucune tâche C2/i)).toBeInTheDocument();
|
||||
expect(screen.queryByTestId('c2-task-row')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -66,7 +66,7 @@ describe('ExecuteViaC2Modal', () => {
|
||||
it('renders modal with title and callback table', async () => {
|
||||
renderModal();
|
||||
expect(screen.getByTestId('c2-modal')).toBeInTheDocument();
|
||||
expect(screen.getByText('Execute via C2')).toBeInTheDocument();
|
||||
expect(screen.getByText('Exécuter via C2')).toBeInTheDocument();
|
||||
await waitFor(() => {
|
||||
expect(screen.getAllByTestId('c2-callback-row')).toHaveLength(2);
|
||||
});
|
||||
@@ -148,7 +148,7 @@ describe('ExecuteViaC2Modal', () => {
|
||||
await waitFor(() => {
|
||||
expect(screen.getAllByTestId('c2-callback-row')).toHaveLength(2);
|
||||
});
|
||||
fireEvent.click(screen.getByRole('button', { name: /cancel/i }));
|
||||
fireEvent.click(screen.getByRole('button', { name: /Annuler/i }));
|
||||
expect(onClose).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ describe('ImportC2HistoryModal — step 1: callback picker', () => {
|
||||
it('renders modal with title and callback rows', async () => {
|
||||
renderModal();
|
||||
expect(screen.getByTestId('c2-import-modal')).toBeInTheDocument();
|
||||
expect(screen.getByText('Import C2 history')).toBeInTheDocument();
|
||||
expect(screen.getByText("Importer l'historique C2")).toBeInTheDocument();
|
||||
await waitFor(() => {
|
||||
expect(screen.getAllByTestId('c2-import-callback-row')).toHaveLength(2);
|
||||
});
|
||||
@@ -322,7 +322,7 @@ describe('ImportC2HistoryModal — toast wording', () => {
|
||||
fireEvent.click(screen.getByTestId('c2-import-submit-btn'));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('Imported 1 task(s)')).toBeInTheDocument();
|
||||
expect(screen.getByText('1 tâche(s) importée(s)')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -342,7 +342,7 @@ describe('ImportC2HistoryModal — toast wording', () => {
|
||||
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
screen.getByText('Imported 0 task(s), 1 already attached'),
|
||||
screen.getByText('0 importée(s), 1 déjà attachée(s)'),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -374,7 +374,7 @@ describe('ImportC2HistoryModal — Cancel button', () => {
|
||||
await waitFor(() => {
|
||||
expect(screen.getAllByTestId('c2-import-callback-row')).toHaveLength(2);
|
||||
});
|
||||
fireEvent.click(screen.getByRole('button', { name: /cancel/i }));
|
||||
fireEvent.click(screen.getByRole('button', { name: /Annuler/i }));
|
||||
expect(onClose).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user