You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Replace uses of checkDeviceTrust
with getDeviceVerificationStatus
(#10663)
matrix-org/matrix-js-sdk#3287 and matrix-org/matrix-js-sdk#3303 added a new API called getDeviceVerificationStatus. Let's use it.
This commit is contained in:
committed by
GitHub
parent
aa8c0f5cc7
commit
d7bb8043ea
@ -18,9 +18,8 @@ import React from "react";
|
||||
import { render, RenderResult, screen } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { mocked, Mocked } from "jest-mock";
|
||||
import { IMyDevice, MatrixClient } from "matrix-js-sdk/src/matrix";
|
||||
import { CryptoApi, DeviceVerificationStatus, IMyDevice, MatrixClient } from "matrix-js-sdk/src/matrix";
|
||||
import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo";
|
||||
import { DeviceTrustLevel } from "matrix-js-sdk/src/crypto/CrossSigning";
|
||||
|
||||
import dis from "../../src/dispatcher/dispatcher";
|
||||
import { showToast } from "../../src/toasts/UnverifiedSessionToast";
|
||||
@ -55,7 +54,11 @@ describe("UnverifiedSessionToast", () => {
|
||||
|
||||
return null;
|
||||
});
|
||||
client.checkDeviceTrust.mockReturnValue(new DeviceTrustLevel(true, false, false, false));
|
||||
client.getCrypto.mockReturnValue({
|
||||
getDeviceVerificationStatus: jest
|
||||
.fn()
|
||||
.mockResolvedValue(new DeviceVerificationStatus({ crossSigningVerified: true })),
|
||||
} as unknown as CryptoApi);
|
||||
jest.spyOn(dis, "dispatch");
|
||||
jest.spyOn(DeviceListener.sharedInstance(), "dismissUnverifiedSessions");
|
||||
});
|
||||
|
Reference in New Issue
Block a user