( workspace: Workspace, name: string | RegExp, actionMock: MockInstance, )
| 73 | * enough to prove that the workspaceStatus was calculated correctly. |
| 74 | */ |
| 75 | const testButton = async ( |
| 76 | workspace: Workspace, |
| 77 | name: string | RegExp, |
| 78 | actionMock: MockInstance, |
| 79 | ) => { |
| 80 | await renderWorkspacePage(workspace); |
| 81 | const workspaceActions = screen.getByTestId("workspace-actions"); |
| 82 | const button = within(workspaceActions).getByRole("button", { name }); |
| 83 | |
| 84 | const user = userEvent.setup(); |
| 85 | await user.click(button); |
| 86 | expect(actionMock).toHaveBeenCalled(); |
| 87 | }; |
| 88 | |
| 89 | afterEach(() => { |
| 90 | MockServerSocket.clean(); |
no test coverage detected