diff --git a/spec/unit/matrixrtc/MatrixRTCSession.spec.ts b/spec/unit/matrixrtc/MatrixRTCSession.spec.ts index 34db746c53e..2c40e9a2230 100644 --- a/spec/unit/matrixrtc/MatrixRTCSession.spec.ts +++ b/spec/unit/matrixrtc/MatrixRTCSession.spec.ts @@ -102,6 +102,8 @@ describe("MatrixRTCSession", () => { roomId: randomString(8), getLiveTimeline: jest.fn().mockReturnValue({ getState: jest.fn().mockReturnValue({ + on: jest.fn(), + off: jest.fn(), getStateEvents: (_type: string, _stateKey: string) => [ { getType: jest.fn().mockReturnValue(EventType.GroupCallMemberPrefix), @@ -124,6 +126,8 @@ describe("MatrixRTCSession", () => { roomId: randomString(8), getLiveTimeline: jest.fn().mockReturnValue({ getState: jest.fn().mockReturnValue({ + on: jest.fn(), + off: jest.fn(), getStateEvents: (_type: string, _stateKey: string) => [ { getType: jest.fn().mockReturnValue(EventType.GroupCallMemberPrefix), diff --git a/spec/unit/matrixrtc/mocks.ts b/spec/unit/matrixrtc/mocks.ts index ac5d48a1363..84496e657da 100644 --- a/spec/unit/matrixrtc/mocks.ts +++ b/spec/unit/matrixrtc/mocks.ts @@ -24,8 +24,6 @@ export function makeMockRoom(memberships: CallMembershipData[], localAge: number const roomState = makeMockRoomState(memberships, roomId, localAge); return { roomId: roomId, - on: jest.fn(), - off: jest.fn(), hasMembershipState: jest.fn().mockReturnValue(true), getLiveTimeline: jest.fn().mockReturnValue({ getState: jest.fn().mockReturnValue(roomState), @@ -36,6 +34,8 @@ export function makeMockRoom(memberships: CallMembershipData[], localAge: number export function makeMockRoomState(memberships: CallMembershipData[], roomId: string, localAge: number | null = null) { const event = mockRTCEvent(memberships, roomId, localAge); return { + on: jest.fn(), + off: jest.fn(), getStateEvents: (_: string, stateKey: string) => { if (stateKey !== undefined) return event; return [event];