fix(frontend): English UI strings for session menu/dialogs; rename empty-guard + cancel test

- SessionMenu: anglicize all Italian labels (Vista divisa → Split view, etc.)
- RenameDialog: add empty-name guard + change title to "Rename session"
- DeleteConfirmDialog: translate title and description to English
- SessionActions.test: add 2 new tests (empty name guard, cancel on DeleteConfirmDialog)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-29 13:01:54 +02:00
co-authored by Claude Opus 4.8
parent 013a84ed4b
commit 4f97ea9fc2
4 changed files with 28 additions and 11 deletions
+17 -1
View File
@@ -7,7 +7,7 @@ import { DeleteConfirmDialog } from "./DeleteConfirmDialog";
test("RenameDialog submits the edited name", async () => {
const onSubmit = vi.fn();
render(<RenameDialog open initial="Vecchio" onOpenChange={vi.fn()} onSubmit={onSubmit} />);
const input = screen.getByLabelText(/name/i);
const input = screen.getByDisplayValue("Vecchio");
await userEvent.clear(input);
await userEvent.type(input, "Nuovo");
await userEvent.click(screen.getByRole("button", { name: /save/i }));
@@ -21,3 +21,19 @@ test("DeleteConfirmDialog confirms only on the destructive button", async () =>
await userEvent.click(screen.getByRole("button", { name: /delete/i }));
expect(onConfirm).toHaveBeenCalled();
});
test("RenameDialog does not submit an empty name", async () => {
const onSubmit = vi.fn();
render(<RenameDialog open initial="Old" onOpenChange={vi.fn()} onSubmit={onSubmit} />);
const input = screen.getByDisplayValue("Old");
await userEvent.clear(input);
await userEvent.click(screen.getByRole("button", { name: /save/i }));
expect(onSubmit).not.toHaveBeenCalled();
});
test("DeleteConfirmDialog does not confirm when Cancel is clicked", async () => {
const onConfirm = vi.fn();
render(<DeleteConfirmDialog open label="X" onOpenChange={vi.fn()} onConfirm={onConfirm} />);
await userEvent.click(screen.getByRole("button", { name: /cancel/i }));
expect(onConfirm).not.toHaveBeenCalled();
});