mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
fix: update DeleteWorkspaceOptions
to pick properties correctly (#13423)
* fix: update typo * fix: update typo in call site * fix: update type for deleteWorkspace mock * fix: update one more type mismatch
This commit is contained in:
@ -314,7 +314,7 @@ type RestartWorkspaceParameters = Readonly<{
|
||||
|
||||
export type DeleteWorkspaceOptions = Pick<
|
||||
TypesGen.CreateWorkspaceBuildRequest,
|
||||
"log_level" & "orphan"
|
||||
"log_level" | "orphan"
|
||||
>;
|
||||
|
||||
export type DeploymentConfig = Readonly<{
|
||||
|
@ -161,7 +161,9 @@ describe("WorkspacePage", () => {
|
||||
});
|
||||
await user.click(confirmButton);
|
||||
// arguments are workspace.name, log level (undefined), and orphan
|
||||
expect(deleteWorkspaceMock).toBeCalledWith(MockFailedWorkspace.id, {
|
||||
expect(deleteWorkspaceMock).toBeCalledWith<
|
||||
[string, apiModule.DeleteWorkspaceOptions]
|
||||
>(MockFailedWorkspace.id, {
|
||||
log_level: undefined,
|
||||
orphan: true,
|
||||
});
|
||||
@ -425,8 +427,10 @@ describe("WorkspacePage", () => {
|
||||
|
||||
test("Retry with debug logs", async () => {
|
||||
await testButton(failedDelete, retryDebugButtonRe, mockDelete);
|
||||
expect(mockDelete).toBeCalledWith(failedDelete.id, {
|
||||
logLevel: "debug",
|
||||
expect(mockDelete).toBeCalledWith<
|
||||
[string, apiModule.DeleteWorkspaceOptions]
|
||||
>(failedDelete.id, {
|
||||
log_level: "debug",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -173,7 +173,7 @@ export const WorkspaceReadyPage: FC<WorkspaceReadyPageProps> = ({
|
||||
stopWorkspaceMutation.mutate({ logLevel });
|
||||
break;
|
||||
case "delete":
|
||||
deleteWorkspaceMutation.mutate({ logLevel });
|
||||
deleteWorkspaceMutation.mutate({ log_level: logLevel });
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user