diff --git a/spec/unit/crypto/algorithms/megolm.spec.js b/spec/unit/crypto/algorithms/megolm.spec.js index dd846403f..22888d1a3 100644 --- a/spec/unit/crypto/algorithms/megolm.spec.js +++ b/spec/unit/crypto/algorithms/megolm.spec.js @@ -321,6 +321,13 @@ describe("MegolmDecryption", function() { rotation_period_ms: 9999999999999, }, }); + + // Splice the real method onto the mock object as megolm uses this method + // on the crypto class in order to encrypt / start sessions + mockCrypto.encryptAndSendToDevices = Crypto.prototype.encryptAndSendToDevices; + mockCrypto.olmDevice = olmDevice; + mockCrypto.baseApis = mockBaseApis; + mockRoom = { getEncryptionTargetMembers: jest.fn().mockReturnValue( [{ userId: "@alice:home.server" }], diff --git a/spec/unit/webrtc/call.spec.ts b/spec/unit/webrtc/call.spec.ts index 7308bb262..fe7fa72ba 100644 --- a/spec/unit/webrtc/call.spec.ts +++ b/spec/unit/webrtc/call.spec.ts @@ -471,6 +471,7 @@ describe('Call', function() { }, }; }, + getSender: () => "@test:foo", }); await call.updateLocalUsermediaStream( @@ -510,6 +511,7 @@ describe('Call', function() { [SDPStreamMetadataKey]: {}, }; }, + getSender: () => "@test:foo", }); await call.upgradeCall(false, true);