Replace MatrixClient.prepareToEncrypt
by MatrixClient.getCrypto.prepareToEncrypt
(#146)
This commit is contained in:
parent
503d9004d1
commit
bce02634f7
5 changed files with 6 additions and 7 deletions
|
@ -588,7 +588,6 @@ describe("LegacyCallHandler without third party protocols", () => {
|
|||
jest.spyOn(MatrixClientPeg.safeGet(), "supportsVoip").mockReturnValue(true);
|
||||
|
||||
MatrixClientPeg.safeGet().isFallbackICEServerAllowed = jest.fn();
|
||||
MatrixClientPeg.safeGet().prepareToEncrypt = jest.fn();
|
||||
|
||||
MatrixClientPeg.safeGet().pushRules = {
|
||||
global: {
|
||||
|
|
|
@ -573,10 +573,9 @@ describe("<SendMessageComposer/>", () => {
|
|||
const cli = stubClient();
|
||||
cli.isCryptoEnabled = jest.fn().mockReturnValue(true);
|
||||
cli.isRoomEncrypted = jest.fn().mockReturnValue(true);
|
||||
cli.prepareToEncrypt = jest.fn();
|
||||
const room = mkStubRoom("!roomId:server", "Room", cli);
|
||||
|
||||
expect(cli.prepareToEncrypt).not.toHaveBeenCalled();
|
||||
expect(cli.getCrypto()!.prepareToEncrypt).not.toHaveBeenCalled();
|
||||
|
||||
const { container } = render(
|
||||
<MatrixClientContext.Provider value={cli}>
|
||||
|
@ -588,9 +587,9 @@ describe("<SendMessageComposer/>", () => {
|
|||
|
||||
// Does not trigger on keydown as that'll cause false negatives for global shortcuts
|
||||
await userEvent.type(composer, "[ControlLeft>][KeyK][/ControlLeft]");
|
||||
expect(cli.prepareToEncrypt).not.toHaveBeenCalled();
|
||||
expect(cli.getCrypto()!.prepareToEncrypt).not.toHaveBeenCalled();
|
||||
|
||||
await userEvent.type(composer, "Hello");
|
||||
expect(cli.prepareToEncrypt).toHaveBeenCalled();
|
||||
expect(cli.getCrypto()!.prepareToEncrypt).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -133,6 +133,7 @@ export function createTestClient(): MatrixClient {
|
|||
isEncryptionEnabledInRoom: jest.fn(),
|
||||
getVerificationRequestsToDeviceInProgress: jest.fn().mockReturnValue([]),
|
||||
setDeviceIsolationMode: jest.fn(),
|
||||
prepareToEncrypt: jest.fn(),
|
||||
}),
|
||||
|
||||
getPushActionsForEvent: jest.fn(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue