You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-09 10:22:46 +03:00
Make test pass again
This commit is contained in:
@@ -65,15 +65,19 @@ describe("self-verifications", () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const storeSessionBackupPrivateKey = jest.fn();
|
const storeSessionBackupPrivateKey = jest.fn();
|
||||||
|
const restoreKeyBackupWithCache = jest.fn(() => Promise.resolve());
|
||||||
|
|
||||||
const client = {
|
const client = {
|
||||||
_crypto: {
|
_crypto: {
|
||||||
_crossSigningInfo,
|
_crossSigningInfo,
|
||||||
_secretStorage,
|
_secretStorage,
|
||||||
storeSessionBackupPrivateKey,
|
storeSessionBackupPrivateKey,
|
||||||
|
getSessionBackupPrivateKey: () => null,
|
||||||
},
|
},
|
||||||
requestSecret: _secretStorage.request.bind(_secretStorage),
|
requestSecret: _secretStorage.request.bind(_secretStorage),
|
||||||
getUserId: () => userId,
|
getUserId: () => userId,
|
||||||
|
getKeyBackupVersion: () => Promise.resolve({}),
|
||||||
|
restoreKeyBackupWithCache,
|
||||||
};
|
};
|
||||||
|
|
||||||
const request = {
|
const request = {
|
||||||
@@ -104,6 +108,8 @@ describe("self-verifications", () => {
|
|||||||
expect(storeSessionBackupPrivateKey.mock.calls[0][0])
|
expect(storeSessionBackupPrivateKey.mock.calls[0][0])
|
||||||
.toEqual(testKey);
|
.toEqual(testKey);
|
||||||
|
|
||||||
|
expect(restoreKeyBackupWithCache).toHaveBeenCalled();
|
||||||
|
|
||||||
expect(result).toBeInstanceOf(Array);
|
expect(result).toBeInstanceOf(Array);
|
||||||
expect(result[0][0]).toBe(testKeyPub);
|
expect(result[0][0]).toBe(testKeyPub);
|
||||||
expect(result[1][0]).toBe(testKeyPub);
|
expect(result[1][0]).toBe(testKeyPub);
|
||||||
|
Reference in New Issue
Block a user