Skip to content

Commit ad793c1

Browse files
committed
Test for new notification event type
1 parent 3c385a1 commit ad793c1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

spec/unit/matrixrtc/MatrixRTCSession.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,20 @@ describe("MatrixRTCSession", () => {
363363
await Promise.race([sentStateEvent, new Promise((resolve) => setTimeout(resolve, 5000))]);
364364
mockRoomState(mockRoom, [{ ...membershipTemplate, user_id: client.getUserId()! }]);
365365
sess!.onRTCSessionMemberUpdate();
366+
const ownMembershipId = sess?.memberships[0].eventId;
366367

368+
expect(client.sendEvent).toHaveBeenCalledWith(mockRoom!.roomId, EventType.RTCNotification, {
369+
"m.mentions": { user_ids: [], room: true },
370+
"notification_type": "ring",
371+
"m.relates_to": {
372+
event_id: ownMembershipId,
373+
rel_type: "org.matrix.msc4075.rtc.notification.parent",
374+
},
375+
"lifetime": 30000,
376+
"sender_ts": expect.any(Number),
377+
});
378+
379+
// check if deprecated notify event is also sent
367380
expect(client.sendEvent).toHaveBeenCalledWith(mockRoom!.roomId, EventType.CallNotify, {
368381
"application": "m.call",
369382
"m.mentions": { user_ids: [], room: true },

0 commit comments

Comments
 (0)