Remove references to MatrixClient.crypto (#28204)

* Remove `VerificationExplorer`

* Remove `remakeolm` slash command

* Remove call to `crypto.cancelAndResendAllOutgoingKeyRequests`

* Remove crypto mock in `LoginWithQR-test.tsx`

* Remove `StopGadWidgetDriver.sendToDevice`

* Remove remaining mock
This commit is contained in:
Florian Duros 2024-10-16 16:13:14 +02:00 committed by Michael Telatynski
parent ea5cba3649
commit 7236953d07
No known key found for this signature in database
GPG key ID: A2B008A5F49F5D0D
12 changed files with 0 additions and 380 deletions

View file

@ -18,7 +18,6 @@ import {
MsgType,
RelationType,
} from "matrix-js-sdk/src/matrix";
import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo";
import {
Widget,
MatrixWidgetType,
@ -171,54 +170,6 @@ describe("StopGapWidgetDriver", () => {
expect(listener).toHaveBeenCalledWith(openIdUpdate);
});
describe("sendToDevice", () => {
const contentMap = {
"@alice:example.org": {
"*": {
hello: "alice",
},
},
"@bob:example.org": {
bobDesktop: {
hello: "bob",
},
},
};
let driver: WidgetDriver;
beforeEach(() => {
driver = mkDefaultDriver();
});
it("sends unencrypted messages", async () => {
await driver.sendToDevice("org.example.foo", false, contentMap);
expect(client.queueToDevice.mock.calls).toMatchSnapshot();
});
it("sends encrypted messages", async () => {
const aliceWeb = new DeviceInfo("aliceWeb");
const aliceMobile = new DeviceInfo("aliceMobile");
const bobDesktop = new DeviceInfo("bobDesktop");
mocked(client.crypto!.deviceList).downloadKeys.mockResolvedValue(
new Map([
[
"@alice:example.org",
new Map([
["aliceWeb", aliceWeb],
["aliceMobile", aliceMobile],
]),
],
["@bob:example.org", new Map([["bobDesktop", bobDesktop]])],
]),
);
await driver.sendToDevice("org.example.foo", true, contentMap);
expect(client.encryptAndSendToDevices.mock.calls).toMatchSnapshot();
});
});
describe("getTurnServers", () => {
let driver: WidgetDriver;

View file

@ -1,82 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`StopGapWidgetDriver sendToDevice sends encrypted messages 1`] = `
[
[
[
{
"deviceInfo": DeviceInfo {
"algorithms": [],
"deviceId": "aliceWeb",
"keys": {},
"known": false,
"signatures": {},
"unsigned": {},
"verified": 0,
},
"userId": "@alice:example.org",
},
{
"deviceInfo": DeviceInfo {
"algorithms": [],
"deviceId": "aliceMobile",
"keys": {},
"known": false,
"signatures": {},
"unsigned": {},
"verified": 0,
},
"userId": "@alice:example.org",
},
],
{
"hello": "alice",
},
],
[
[
{
"deviceInfo": DeviceInfo {
"algorithms": [],
"deviceId": "bobDesktop",
"keys": {},
"known": false,
"signatures": {},
"unsigned": {},
"verified": 0,
},
"userId": "@bob:example.org",
},
],
{
"hello": "bob",
},
],
]
`;
exports[`StopGapWidgetDriver sendToDevice sends unencrypted messages 1`] = `
[
[
{
"batch": [
{
"deviceId": "*",
"payload": {
"hello": "alice",
},
"userId": "@alice:example.org",
},
{
"deviceId": "bobDesktop",
"payload": {
"hello": "bob",
},
"userId": "@bob:example.org",
},
],
"eventType": "org.example.foo",
},
],
]
`;