Skip to content

Commit ceda4ea

Browse files
committed
fix: await promises in WorkspacePage.test.tsx
1 parent d9a61dd commit ceda4ea

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

site/src/pages/WorkspacePage/WorkspacePage.test.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-floating-promises */
21
import { fireEvent, screen, waitFor } from "@testing-library/react"
32
import userEvent from "@testing-library/user-event"
43
import EventSource from "eventsourcemock"
@@ -94,7 +93,7 @@ describe("WorkspacePage", () => {
9493
const stopWorkspaceMock = jest
9594
.spyOn(api, "stopWorkspace")
9695
.mockResolvedValueOnce(MockWorkspaceBuild)
97-
testButton(Language.stop, stopWorkspaceMock)
96+
await testButton(Language.stop, stopWorkspaceMock)
9897
})
9998

10099
it("requests a delete job when the user presses Delete and confirms", async () => {
@@ -128,7 +127,7 @@ describe("WorkspacePage", () => {
128127
const startWorkspaceMock = jest
129128
.spyOn(api, "startWorkspace")
130129
.mockImplementation(() => Promise.resolve(MockWorkspaceBuild))
131-
testButton(Language.start, startWorkspaceMock)
130+
await testButton(Language.start, startWorkspaceMock)
132131
})
133132
it("requests cancellation when the user presses Cancel", async () => {
134133
server.use(

0 commit comments

Comments
 (0)