Use new api CryptoApi.getCrossSigningStatus in CrossSigningPanel (#11052)

* Use new api `CryptoApi.getCrossSigningStatus` in `CrossSigningPanel`

* Update `CrossSigningPanel-test.tsx`

* Update `publicKeysOnDevice`

* Fix `CryptoApi` import

* Fix strict type

* Fix tests

* Remove `crossSigningInfo` in `mockClientMethodsCrypto`

* Move matrix client initialization in `beforeEach`
This commit is contained in:
Florian Duros 2023-06-12 20:33:39 +02:00 committed by GitHub
parent a40d1ec670
commit d5d1ec775c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 28 deletions

View file

@ -156,9 +156,16 @@ export const mockClientMethodsCrypto = (): Partial<
crypto: {
isSecretStorageReady: jest.fn(),
getSessionBackupPrivateKey: jest.fn(),
crossSigningInfo: {
getId: jest.fn(),
isStoredInSecretStorage: jest.fn(),
},
},
getCrypto: jest.fn().mockReturnValue({
getCrossSigningStatus: jest.fn().mockResolvedValue({
publicKeysOnDevice: true,
privateKeysInSecretStorage: false,
privateKeysCachedLocally: {
masterKey: true,
selfSigningKey: true,
userSigningKey: true,
},
}),
}),
});