Skip to content

fix: display explicit 'retry' button(s) when a workspace fails #10720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Nov 22, 2023
Merged
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
Prev Previous commit
Next Next commit
fix: update old tests to be correctly parameterized
  • Loading branch information
Parkreiner committed Nov 17, 2023
commit 8d7fe73adf30fb25cdc40d63dc72b83bef9b9c36
16 changes: 5 additions & 11 deletions site/src/pages/WorkspacePage/WorkspacePage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,12 @@ describe("WorkspacePage", () => {
},
),
);

const startWorkspaceMock = jest
.spyOn(api, "startWorkspace")
.mockImplementation(() => Promise.resolve(MockWorkspaceBuild));
await testButton(MockWorkspace, "Start", startWorkspaceMock);

await testButton(MockStoppedWorkspace, "Start", startWorkspaceMock);
});

it("requests a stop job when the user presses Stop", async () => {
Expand Down Expand Up @@ -221,20 +223,12 @@ describe("WorkspacePage", () => {
},
),
);

const cancelWorkspaceMock = jest
.spyOn(api, "cancelWorkspaceBuild")
.mockImplementation(() => Promise.resolve({ message: "job canceled" }));

await renderWorkspacePage(MockWorkspace);

const workspaceActions = screen.getByTestId("workspace-actions");
const cancelButton = within(workspaceActions).getByRole("button", {
name: "Cancel",
});

await userEvent.click(cancelButton);

expect(cancelWorkspaceMock).toBeCalled();
await testButton(MockStartingWorkspace, "Cancel", cancelWorkspaceMock);
});

it("requests an update when the user presses Update", async () => {
Expand Down