From 35ac4c78a58b29313c2e72ca092a7f6c1a6ef8df Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Fri, 3 Mar 2023 11:43:39 +0100 Subject: [PATCH] Fix type errors in tests --- .../views/right_panel/UserInfo-test.tsx | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/test/components/views/right_panel/UserInfo-test.tsx b/test/components/views/right_panel/UserInfo-test.tsx index 4dfd6fef2b6..fe943a88aae 100644 --- a/test/components/views/right_panel/UserInfo-test.tsx +++ b/test/components/views/right_panel/UserInfo-test.tsx @@ -556,23 +556,6 @@ describe("", () => { }); }); - it("calling .invite with a null roomId still calls .invite and shows default error message", async () => { - inviteSpy.mockRejectedValue({ this: "could be anything" }); - - // render the component and click the button - renderComponent({ canInvite: true, member: new RoomMember(null, defaultUserId) }); - const inviteButton = screen.getByRole("button", { name: /invite/i }); - expect(inviteButton).toBeInTheDocument(); - await userEvent.click(inviteButton); - - expect(inviteSpy).toHaveBeenCalledTimes(1); - - // check that the default test error message is displayed - await waitFor(() => { - expect(screen.getByText(/operation failed/i)).toBeInTheDocument(); - }); - }); - it("shows a modal before ignoring the user", async () => { const originalCreateDialog = Modal.createDialog; const modalSpy = (Modal.createDialog = jest.fn().mockReturnValue({ @@ -624,7 +607,7 @@ describe("", () => { ["for a User", defaultUser, defaultUser.avatarUrl], ])( "clicking »message« %s should start a DM", - async (test: string, member: RoomMember | User, expectedAvatarUrl: string) => { + async (test: string, member: RoomMember | User, expectedAvatarUrl: string | undefined) => { renderComponent({ member }); await userEvent.click(screen.getByText("Message")); expect(startDmOnFirstMessage).toHaveBeenCalledWith(mockClient, [