1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-07-31 15:24:23 +03:00
This commit is contained in:
David Baker
2023-01-25 10:59:03 +00:00
parent 1828e2849c
commit ce2a9d7036

View File

@ -40,6 +40,7 @@ import {
MockMediaStreamTrack,
installWebRTCMocks,
MockRTCPeerConnection,
MockRTCRtpTransceiver,
SCREENSHARE_STREAM_ID,
} from "../../test-utils/webrtc";
import { CallFeed } from "../../../src/webrtc/callFeed";
@ -536,6 +537,13 @@ describe("Call", function () {
it("if local video", async () => {
call.getOpponentMember = jest.fn().mockReturnValue({ userId: "@bob:bar.uk" });
// since this is testing for the presence of a local sender, we need to add a transciever
// rather than just a source track
(call as any).transceivers.set(
"m.usermedia:video",
new MockRTCRtpTransceiver(call.peerConn as unknown as MockRTCPeerConnection),
);
(call as any).pushNewLocalFeed(
new MockMediaStream("remote_stream1", [new MockMediaStreamTrack("track_id", "video")]),
SDPStreamMetadataPurpose.Usermedia,