fix(site): enable dormant workspace to be deleted (#13850)

This commit is contained in:
Bruno Quaresma
2024-07-09 14:55:46 -03:00
committed by GitHub
parent af001773db
commit 01b30eaa32
2 changed files with 13 additions and 1 deletions
@@ -206,6 +206,18 @@ export const OpenDownloadLogs: Story = {
},
};
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();
},
};
function generateLogs(count: number) {
return Array.from({ length: count }, (_, i) => ({
output: `log ${i + 1}`,
@@ -48,7 +48,7 @@ export const abilitiesByWorkspaceStatus = (
return {
actions: ["activate"],
canCancel: false,
canAcceptJobs: false,
canAcceptJobs: true,
};
}