Skip to content

Commit faafc7c

Browse files
committed
fix(site): enable dormant workspace to be deleted (#13850)
(cherry picked from commit 01b30ea)
1 parent 534d4ea commit faafc7c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

site/src/pages/WorkspacePage/WorkspaceActions/WorkspaceActions.stories.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Meta, StoryObj } from "@storybook/react";
22
import * as Mocks from "testHelpers/entities";
33
import { WorkspaceActions } from "./WorkspaceActions";
4+
import { userEvent, within, expect } from "@storybook/test";
45

56
const meta: Meta<typeof WorkspaceActions> = {
67
title: "pages/WorkspacePage/WorkspaceActions",
@@ -140,3 +141,15 @@ export const CancelHiddenForUser: Story = {
140141
isOwner: false,
141142
},
142143
};
144+
145+
export const CanDeleteDormantWorkspace: Story = {
146+
args: {
147+
workspace: Mocks.MockDormantWorkspace,
148+
},
149+
play: async ({ canvasElement }) => {
150+
const canvas = within(canvasElement);
151+
await userEvent.click(canvas.getByRole("button", { name: "More options" }));
152+
const deleteButton = canvas.getByText("Delete…");
153+
await expect(deleteButton).toBeEnabled();
154+
},
155+
};

site/src/pages/WorkspacePage/WorkspaceActions/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const abilitiesByWorkspaceStatus = (
4949
return {
5050
actions: ["activate"],
5151
canCancel: false,
52-
canAcceptJobs: false,
52+
canAcceptJobs: true,
5353
};
5454
}
5555

0 commit comments

Comments
 (0)