Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(site): enable dormant workspace to be deleted (#13850)
(cherry picked from commit 01b30ea)
  • Loading branch information
BrunoQuaresma committed Jul 17, 2024
commit faafc7cadc2fb0fc9788761b09d68cca0590dc24
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Meta, StoryObj } from "@storybook/react";
import * as Mocks from "testHelpers/entities";
import { WorkspaceActions } from "./WorkspaceActions";
import { userEvent, within, expect } from "@storybook/test";

const meta: Meta<typeof WorkspaceActions> = {
title: "pages/WorkspacePage/WorkspaceActions",
Expand Down Expand Up @@ -140,3 +141,15 @@ export const CancelHiddenForUser: Story = {
isOwner: false,
},
};

export const CanDeleteDormantWorkspace: Story = {
args: {
workspace: Mocks.MockDormantWorkspace,
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
await userEvent.click(canvas.getByRole("button", { name: "More options" }));
const deleteButton = canvas.getByText("Delete…");
await expect(deleteButton).toBeEnabled();
},
};
2 changes: 1 addition & 1 deletion site/src/pages/WorkspacePage/WorkspaceActions/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const abilitiesByWorkspaceStatus = (
return {
actions: ["activate"],
canCancel: false,
canAcceptJobs: false,
canAcceptJobs: true,
};
}

Expand Down