Use `crypto.isCrossSigningReady` in `CrossSigningPanel` (#11080)

pull/28217/head
Florian Duros 2023-06-14 11:46:14 +02:00 committed by GitHub
parent 3f52de2f5b
commit 127b542233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 6 deletions

View File

@ -102,7 +102,7 @@ export default class CrossSigningPanel extends React.PureComponent<{}, IState> {
const homeserverSupportsCrossSigning = await cli.doesServerSupportUnstableFeature(
"org.matrix.e2e_cross_signing",
);
const crossSigningReady = await cli.isCrossSigningReady();
const crossSigningReady = await crypto.isCrossSigningReady();
this.setState({
crossSigningPublicKeysOnDevice,

View File

@ -59,10 +59,6 @@ describe("<CrossSigningPanel />", () => {
});
describe("when cross signing is ready", () => {
beforeEach(() => {
mockClient.isCrossSigningReady.mockResolvedValue(true);
});
it("should render when keys are not backed up", async () => {
getComponent();
await flushPromises();
@ -93,7 +89,7 @@ describe("<CrossSigningPanel />", () => {
describe("when cross signing is not ready", () => {
beforeEach(() => {
mockClient.isCrossSigningReady.mockResolvedValue(false);
mocked(mockClient.getCrypto()!.isCrossSigningReady).mockResolvedValue(false);
});
it("should render when keys are not backed up", async () => {

View File

@ -167,5 +167,6 @@ export const mockClientMethodsCrypto = (): Partial<
userSigningKey: true,
},
}),
isCrossSigningReady: jest.fn().mockResolvedValue(true),
}),
});