Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 35ac4c7

Browse files
committed
Fix type errors in tests
1 parent bc93548 commit 35ac4c7

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

test/components/views/right_panel/UserInfo-test.tsx

+1-18
Original file line numberDiff line numberDiff line change
@@ -556,23 +556,6 @@ describe("<UserOptionsSection />", () => {
556556
});
557557
});
558558

559-
it("calling .invite with a null roomId still calls .invite and shows default error message", async () => {
560-
inviteSpy.mockRejectedValue({ this: "could be anything" });
561-
562-
// render the component and click the button
563-
renderComponent({ canInvite: true, member: new RoomMember(null, defaultUserId) });
564-
const inviteButton = screen.getByRole("button", { name: /invite/i });
565-
expect(inviteButton).toBeInTheDocument();
566-
await userEvent.click(inviteButton);
567-
568-
expect(inviteSpy).toHaveBeenCalledTimes(1);
569-
570-
// check that the default test error message is displayed
571-
await waitFor(() => {
572-
expect(screen.getByText(/operation failed/i)).toBeInTheDocument();
573-
});
574-
});
575-
576559
it("shows a modal before ignoring the user", async () => {
577560
const originalCreateDialog = Modal.createDialog;
578561
const modalSpy = (Modal.createDialog = jest.fn().mockReturnValue({
@@ -624,7 +607,7 @@ describe("<UserOptionsSection />", () => {
624607
["for a User", defaultUser, defaultUser.avatarUrl],
625608
])(
626609
"clicking »message« %s should start a DM",
627-
async (test: string, member: RoomMember | User, expectedAvatarUrl: string) => {
610+
async (test: string, member: RoomMember | User, expectedAvatarUrl: string | undefined) => {
628611
renderComponent({ member });
629612
await userEvent.click(screen.getByText("Message"));
630613
expect(startDmOnFirstMessage).toHaveBeenCalledWith(mockClient, [

0 commit comments

Comments
 (0)