First batch: remove deprecated calls on MatrixClient
(#28207)
* Remove `initCrypto` mocking * Remove `MatrixClient.downloadKeys` mocking * Remove `MatrixClient.getStoredDevice` mocking * Replace `MatrixClient.setGlobalBlacklistUnverifiedDevices` by `MatrixClient.CryptoApi.globalBlacklistUnverifiedDevices` * Remove `MatrixClient.getStoredCrossSigningForUser` mocking * Replace `MatrixClient.legacyDeviceVerification` by `MatrixClient.CryptoApi.requestDeviceVerification` * Remove `MatrixClient.isCrossSigningReady` mock * Replace `MatrixClient.bootstrapCrossSigning` by `MatrixClient.getCrypto.bootstrapCrossSigning` * Replace `MatrixClient.getCryptoTrustCrossSignedDevices` by `MatrixClient.getCrypto.getTrustCrossSignedDevices` * Replace `MatrixClient.hasSecretStorageKey` by `MatrixClient.SecretStorage.hasKey` * Replace `MatrixClient.getDefaultSecretStorageKeyId` by `MatrixClient.SecretStorage.getDefaultKeyId` * Remove `MatrixClient.encryptAndSendToDevices` call
This commit is contained in:
parent
26a98e5e30
commit
46d13921d0
17 changed files with 22 additions and 55 deletions
|
@ -11,7 +11,6 @@ import { render, RenderResult, screen } from "jest-matrix-react";
|
|||
import userEvent from "@testing-library/user-event";
|
||||
import { mocked, Mocked } from "jest-mock";
|
||||
import { IMyDevice, MatrixClient } from "matrix-js-sdk/src/matrix";
|
||||
import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo";
|
||||
import { CryptoApi, DeviceVerificationStatus } from "matrix-js-sdk/src/crypto-api";
|
||||
|
||||
import dis from "../../../src/dispatcher/dispatcher";
|
||||
|
@ -25,7 +24,6 @@ describe("UnverifiedSessionToast", () => {
|
|||
const otherDevice: IMyDevice = {
|
||||
device_id: "ABC123",
|
||||
};
|
||||
const otherDeviceInfo = new DeviceInfo(otherDevice.device_id);
|
||||
let client: Mocked<MatrixClient>;
|
||||
let renderResult: RenderResult;
|
||||
|
||||
|
@ -40,13 +38,6 @@ describe("UnverifiedSessionToast", () => {
|
|||
|
||||
throw new Error(`Unknown device ${deviceId}`);
|
||||
});
|
||||
client.getStoredDevice.mockImplementation((userId: string, deviceId: string) => {
|
||||
if (deviceId === otherDevice.device_id) {
|
||||
return otherDeviceInfo;
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
client.getCrypto.mockReturnValue({
|
||||
getDeviceVerificationStatus: jest
|
||||
.fn()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue