1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-07 23:02:56 +03:00

Fix tests

This commit is contained in:
Robin Townsend
2022-11-26 00:28:11 -05:00
parent 19e02e894f
commit 5511a6ef8c
2 changed files with 25 additions and 13 deletions

View File

@@ -55,14 +55,20 @@ describe('Group Call Event Handler', function() {
membership: "join",
} as unknown as RoomMember;
const mockEvent = makeMockGroupCallStateEvent(FAKE_ROOM_ID, FAKE_GROUP_CALL_ID);
mockRoom = {
on: () => {},
off: () => {},
roomId: FAKE_ROOM_ID,
currentState: {
getStateEvents: jest.fn().mockReturnValue([makeMockGroupCallStateEvent(
FAKE_ROOM_ID, FAKE_GROUP_CALL_ID,
)]),
getStateEvents: jest.fn((type, key) => {
if (type === mockEvent.getType()) {
return key === undefined ? [mockEvent] : mockEvent;
} else {
return key === undefined ? [] : null;
}
}),
},
getMember: (userId: string) => userId === FAKE_USER_ID ? mockMember : null,
} as unknown as Room;