mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
test(site): fix terminal page test flakiness (#9798)
This commit is contained in:
@@ -58,7 +58,7 @@ const expectTerminalText = (container: HTMLElement, text: string) => {
|
||||
}
|
||||
expect(row.textContent).toContain(text);
|
||||
},
|
||||
{ timeout: 3_000 },
|
||||
{ timeout: 5_000 },
|
||||
);
|
||||
};
|
||||
|
||||
@@ -67,6 +67,9 @@ describe("TerminalPage", () => {
|
||||
const spy = jest
|
||||
.spyOn(API, "getWorkspaceByOwnerAndName")
|
||||
.mockResolvedValue(MockWorkspace);
|
||||
const ws = new WS(
|
||||
`ws://localhost/api/v2/workspaceagents/${MockWorkspaceAgent.id}/pty`,
|
||||
);
|
||||
await renderTerminal(
|
||||
`/${MockUser.username}/${MockWorkspace.name}/terminal`,
|
||||
);
|
||||
@@ -77,6 +80,7 @@ describe("TerminalPage", () => {
|
||||
);
|
||||
});
|
||||
spy.mockRestore();
|
||||
ws.close();
|
||||
});
|
||||
|
||||
it("shows an error if fetching workspace fails", async () => {
|
||||
|
||||
Reference in New Issue
Block a user