Skip to content

Commit 07ec4f8

Browse files
committed
Inline calls to encryptSendKeyAndMessage
1 parent 8793f35 commit 07ec4f8

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

spec/integ/megolm-integ.spec.ts

+19-7
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,16 @@ describe("megolm", () => {
574574
const room = aliceTestClient.client.getRoom(ROOM_ID)!;
575575
const pendingMsg = room.getPendingEvents()[0];
576576

577+
const inboundGroupSessionPromise = expectSendRoomKey(
578+
aliceTestClient.httpBackend,
579+
"@bob:xyz",
580+
testOlmAccount,
581+
p2pSession,
582+
);
583+
577584
await Promise.all([
578585
aliceTestClient.client.resendEvent(pendingMsg, room),
579-
expectSendKeyAndMessage(aliceTestClient.httpBackend, "@bob:xyz", testOlmAccount, p2pSession),
586+
expectSendMegolmMessage(aliceTestClient.httpBackend, inboundGroupSessionPromise),
580587
]);
581588
});
582589
});
@@ -632,14 +639,19 @@ describe("megolm", () => {
632639
d.verified = DeviceInfo.DeviceVerification.VERIFIED;
633640
aliceTestClient.client.crypto?.deviceList.storeDevicesForUser("@bob:xyz", { DEVICE_ID: d });
634641

642+
const inboundGroupSessionPromise = expectSendRoomKey(
643+
aliceTestClient.httpBackend,
644+
"@bob:xyz",
645+
testOlmAccount,
646+
p2pSession,
647+
);
648+
635649
logger.log("Asking alice to re-send");
636650
await Promise.all([
637-
expectSendKeyAndMessage(aliceTestClient.httpBackend, "@bob:xyz", testOlmAccount, p2pSession).then(
638-
(decrypted) => {
639-
expect(decrypted.type).toEqual("m.room.message");
640-
expect(decrypted.content!.body).toEqual("test");
641-
},
642-
),
651+
expectSendMegolmMessage(aliceTestClient.httpBackend, inboundGroupSessionPromise).then((decrypted) => {
652+
expect(decrypted.type).toEqual("m.room.message");
653+
expect(decrypted.content!.body).toEqual("test");
654+
}),
643655
aliceTestClient.client.sendTextMessage(ROOM_ID, "test"),
644656
]);
645657
});

0 commit comments

Comments
 (0)