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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user