Skip to content

Commit d530c4d

Browse files
BrunoQuaresmamafredri
authored andcommitted
fix failed tests
1 parent d70dcf4 commit d530c4d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

site/src/pages/TaskPage/TaskPage.stories.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ export const ActivePreview: Story = {
331331
export const WorkspaceStarting: Story = {
332332
decorators: [withGlobalSnackbar],
333333
beforeEach: () => {
334+
spyOn(API.experimental, "getTask").mockResolvedValue(MockTask);
335+
spyOn(API, "getWorkspaceByOwnerAndName").mockResolvedValue(
336+
MockStoppedWorkspace,
337+
);
334338
spyOn(API, "startWorkspace").mockResolvedValue(
335339
MockStartingWorkspace.latest_build,
336340
);
@@ -385,6 +389,10 @@ export const WorkspaceStarting: Story = {
385389
export const WorkspaceStartFailure: Story = {
386390
decorators: [withGlobalSnackbar],
387391
beforeEach: () => {
392+
spyOn(API.experimental, "getTask").mockResolvedValue(MockTask);
393+
spyOn(API, "getWorkspaceByOwnerAndName").mockResolvedValue(
394+
MockStoppedWorkspace,
395+
);
388396
spyOn(API, "startWorkspace").mockRejectedValue(
389397
new Error("Some unexpected error"),
390398
);
@@ -439,6 +447,10 @@ export const WorkspaceStartFailure: Story = {
439447

440448
export const WorkspaceStartFailureWithDialog: Story = {
441449
beforeEach: () => {
450+
spyOn(API.experimental, "getTask").mockResolvedValue(MockTask);
451+
spyOn(API, "getWorkspaceByOwnerAndName").mockResolvedValue(
452+
MockStoppedWorkspace,
453+
);
442454
spyOn(API, "startWorkspace").mockRejectedValue({
443455
...mockApiError({
444456
message: "Bad Request",

0 commit comments

Comments
 (0)