Skip to content

Commit 404e4c7

Browse files
committed
chore: update renderWorkspacePage to accept parameters
1 parent d635ecd commit 404e4c7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { server } from "testHelpers/server";
2222
import { WorkspacePage } from "./WorkspacePage";
2323

2424
// It renders the workspace page and waits for it be loaded
25-
const renderWorkspacePage = async () => {
25+
const renderWorkspacePage = async (mockWorkspace = MockWorkspace) => {
2626
jest.spyOn(api, "getTemplate").mockResolvedValueOnce(MockTemplate);
2727
jest.spyOn(api, "getTemplateVersionRichParameters").mockResolvedValueOnce([]);
2828
jest
@@ -34,11 +34,13 @@ const renderWorkspacePage = async () => {
3434
options.onDone && options.onDone();
3535
return new WebSocket("");
3636
});
37+
3738
renderWithAuth(<WorkspacePage />, {
38-
route: `/@${MockWorkspace.owner_name}/${MockWorkspace.name}`,
39+
route: `/@${mockWorkspace.owner_name}/${mockWorkspace.name}`,
3940
path: "/:username/:workspace",
4041
});
41-
await screen.findByText(MockWorkspace.name);
42+
43+
await screen.findByText(mockWorkspace.name);
4244
};
4345

4446
/**

0 commit comments

Comments
 (0)