Skip to content

Commit 031d997

Browse files
committed
Fix tests
1 parent 4de79ca commit 031d997

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

test/unit-tests/components/structures/MatrixChat-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ describe("<MatrixChat />", () => {
139139
globalBlacklistUnverifiedDevices: false,
140140
// This needs to not finish immediately because we need to test the screen appears
141141
bootstrapCrossSigning: jest.fn().mockImplementation(() => bootstrapDeferred.promise),
142+
getKeyBackupInfo: jest.fn().mockResolvedValue(null),
142143
}),
143144
secretStorage: {
144145
isStored: jest.fn().mockReturnValue(null),
@@ -149,7 +150,6 @@ describe("<MatrixChat />", () => {
149150
isRoomEncrypted: jest.fn(),
150151
logout: jest.fn(),
151152
getDeviceId: jest.fn(),
152-
getKeyBackupVersion: jest.fn().mockResolvedValue(null),
153153
});
154154
let mockClient: Mocked<MatrixClient>;
155155
const serverConfig = {

test/unit-tests/components/views/dialogs/security/RestoreKeyBackupDialog-test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe("<RestoreKeyBackupDialog />", () => {
2828
beforeEach(() => {
2929
matrixClient = stubClient();
3030
jest.spyOn(recoveryKeyModule, "decodeRecoveryKey").mockReturnValue(new Uint8Array(32));
31-
jest.spyOn(matrixClient, "getKeyBackupVersion").mockResolvedValue({ version: "1" } as KeyBackupInfo);
31+
jest.spyOn(matrixClient.getCrypto()!, "getKeyBackupInfo").mockResolvedValue({ version: "1" } as KeyBackupInfo);
3232
});
3333

3434
it("should render", async () => {
@@ -99,7 +99,7 @@ describe("<RestoreKeyBackupDialog />", () => {
9999

100100
test("should restore key backup when passphrase is filled", async () => {
101101
// Determine that the passphrase is required
102-
jest.spyOn(matrixClient, "getKeyBackupVersion").mockResolvedValue({
102+
jest.spyOn(matrixClient.getCrypto()!, "getKeyBackupInfo").mockResolvedValue({
103103
version: "1",
104104
auth_data: {
105105
private_key_salt: "salt",

test/unit-tests/stores/SetupEncryptionStore-test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe("SetupEncryptionStore", () => {
3737
getDeviceVerificationStatus: jest.fn(),
3838
isDehydrationSupported: jest.fn().mockResolvedValue(false),
3939
startDehydration: jest.fn(),
40+
getKeyBackupInfo: jest.fn().mockResolvedValue(null),
4041
} as unknown as Mocked<CryptoApi>;
4142
client.getCrypto.mockReturnValue(mockCrypto);
4243

0 commit comments

Comments
 (0)