feat(frontend): rename group (reassign members via setSessionGroup)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-29 21:32:32 +02:00
co-authored by Claude Sonnet 4.6
parent 5442a07ced
commit 84db1e1085
2 changed files with 60 additions and 9 deletions
@@ -77,3 +77,22 @@ test("a failed resume keeps the panel open and does not activate the session", a
// panel stays open (document still visible) after the failed resume
await waitFor(() => expect(screen.getByText("Domanda originale")).toBeInTheDocument());
});
test("renaming a group reassigns its members via setSessionGroup", async () => {
const groupSets: Array<{ id: string; group: string }> = [];
server.use(
http.post("http://localhost:8787/sessions/:id/group", async ({ params, request }) => {
const body = (await request.json()) as { group: string };
groupSets.push({ id: params.id as string, group: body.group });
return new HttpResponse(null, { status: 204 });
}),
);
wrap();
await screen.findByText("Aritmologia");
await userEvent.click(screen.getByRole("button", { name: /rename group aritmologia/i }));
const input = await screen.findByLabelText(/name/i, { selector: "input" });
await userEvent.clear(input);
await userEvent.type(input, "Cardiologia");
await userEvent.click(screen.getByRole("button", { name: /save/i }));
await waitFor(() => expect(groupSets).toEqual([{ id: "s1", group: "Cardiologia" }]));
});