1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-06 12:02:40 +03:00

Make tests pass again

Now we know what that bit in the crypto unit test was for...
This commit is contained in:
David Baker
2022-05-10 16:30:04 +01:00
parent 9702e8a5fa
commit 85a6a552b5
2 changed files with 9 additions and 0 deletions

View File

@@ -321,6 +321,13 @@ describe("MegolmDecryption", function() {
rotation_period_ms: 9999999999999, 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 = { mockRoom = {
getEncryptionTargetMembers: jest.fn().mockReturnValue( getEncryptionTargetMembers: jest.fn().mockReturnValue(
[{ userId: "@alice:home.server" }], [{ userId: "@alice:home.server" }],

View File

@@ -471,6 +471,7 @@ describe('Call', function() {
}, },
}; };
}, },
getSender: () => "@test:foo",
}); });
await call.updateLocalUsermediaStream( await call.updateLocalUsermediaStream(
@@ -510,6 +511,7 @@ describe('Call', function() {
[SDPStreamMetadataKey]: {}, [SDPStreamMetadataKey]: {},
}; };
}, },
getSender: () => "@test:foo",
}); });
await call.upgradeCall(false, true); await call.upgradeCall(false, true);