ElementR: Cross user verification (#11364)
The hard work has been done in previous PRs in the js-sdk, so this is now just a case of updating a few call sites to use the new APIs.
This commit is contained in:
parent
e887c6d71f
commit
579b0dd10a
8 changed files with 33 additions and 31 deletions
|
@ -25,7 +25,6 @@ import {
|
|||
ClientStoppedError,
|
||||
} from "matrix-js-sdk/src/matrix";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { CrossSigningInfo } from "matrix-js-sdk/src/crypto/CrossSigning";
|
||||
import { CryptoEvent } from "matrix-js-sdk/src/crypto";
|
||||
import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup";
|
||||
|
||||
|
@ -92,6 +91,7 @@ describe("DeviceListener", () => {
|
|||
getUserDeviceInfo: jest.fn().mockResolvedValue(new Map()),
|
||||
isCrossSigningReady: jest.fn().mockResolvedValue(true),
|
||||
isSecretStorageReady: jest.fn().mockResolvedValue(true),
|
||||
userHasCrossSigningKeys: jest.fn(),
|
||||
} as unknown as Mocked<CryptoApi>;
|
||||
mockClient = getMockClientWithEventEmitter({
|
||||
isGuest: jest.fn(),
|
||||
|
@ -102,7 +102,6 @@ describe("DeviceListener", () => {
|
|||
isVersionSupported: jest.fn().mockResolvedValue(true),
|
||||
isInitialSyncComplete: jest.fn().mockReturnValue(true),
|
||||
getKeyBackupEnabled: jest.fn(),
|
||||
getStoredCrossSigningForUser: jest.fn(),
|
||||
waitForClientWellKnown: jest.fn(),
|
||||
isRoomEncrypted: jest.fn(),
|
||||
getClientWellKnown: jest.fn(),
|
||||
|
@ -324,7 +323,7 @@ describe("DeviceListener", () => {
|
|||
});
|
||||
|
||||
it("shows verify session toast when account has cross signing", async () => {
|
||||
mockClient!.getStoredCrossSigningForUser.mockReturnValue(new CrossSigningInfo(userId));
|
||||
mockCrypto!.userHasCrossSigningKeys.mockResolvedValue(true);
|
||||
await createAndStart();
|
||||
|
||||
expect(mockCrypto!.getUserDeviceInfo).toHaveBeenCalled();
|
||||
|
@ -335,7 +334,7 @@ describe("DeviceListener", () => {
|
|||
|
||||
it("checks key backup status when when account has cross signing", async () => {
|
||||
mockCrypto!.getCrossSigningKeyId.mockResolvedValue(null);
|
||||
mockClient!.getStoredCrossSigningForUser.mockReturnValue(new CrossSigningInfo(userId));
|
||||
mockCrypto!.userHasCrossSigningKeys.mockResolvedValue(true);
|
||||
await createAndStart();
|
||||
|
||||
expect(mockClient!.getKeyBackupEnabled).toHaveBeenCalled();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue