feat: add confirmation dialogs for workspace and session deletion

- Replace inline project/workspace delete confirmation with ConfirmDialog
- Add ConfirmDialog before deleting active sessions from dashboard
- Update ProjectsPage and DashboardPage tests for modal flow
- Fix dashboard test mock paths (git-repositories, tool-types)

Quality gates: typecheck, lint, build pass; targeted tests 12/12 pass
This commit is contained in:
Developer
2026-06-15 11:50:09 +00:00
parent 5ed5e1c84b
commit b21456093e
4 changed files with 123 additions and 43 deletions
+7 -3
View File
@@ -173,7 +173,7 @@ describe("ProjectsPage", () => {
expect(lastAction).toBe(workspaceLink);
});
it("shows delete confirmation and deletes project", async () => {
it("shows delete confirmation dialog and deletes project", async () => {
const listMock = vi
.spyOn(projectsApi, "listProjects")
.mockResolvedValue(mockProjects);
@@ -193,9 +193,13 @@ describe("ProjectsPage", () => {
if (!alphaCard) throw new Error("Card not found");
fireEvent.click(within(alphaCard).getByRole("button", { name: /delete/i }));
expect(within(alphaCard).getByText(/are you sure/i)).toBeInTheDocument();
fireEvent.click(within(alphaCard).getByRole("button", { name: /delete/i }));
const dialog = screen.getByRole("dialog");
expect(dialog).toBeInTheDocument();
expect(within(dialog).getByText(/delete workspace/i)).toBeInTheDocument();
expect(within(dialog).getByText(/are you sure/i)).toBeInTheDocument();
fireEvent.click(within(dialog).getByRole("button", { name: /delete/i }));
await waitFor(() => {
expect(deleteMock).toHaveBeenCalledWith("proj-1");