Skip to content

Commit a2bf9c0

Browse files
committed
Inline calls to encryptSendKeyAndMessage
1 parent b0c5dbe commit a2bf9c0

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
@@ -692,9 +692,16 @@ describe("megolm", () => {
692692
const room = aliceTestClient.client.getRoom(ROOM_ID)!;
693693
const pendingMsg = room.getPendingEvents()[0];
694694

695+
const inboundGroupSessionPromise = expectSendRoomKey(
696+
aliceTestClient.httpBackend,
697+
"@bob:xyz",
698+
testOlmAccount,
699+
p2pSession,
700+
);
701+
695702
await Promise.all([
696703
aliceTestClient.client.resendEvent(pendingMsg, room),
697-
expectSendKeyAndMessage(aliceTestClient.httpBackend, "@bob:xyz", testOlmAccount, p2pSession),
704+
expectSendMegolmMessage(aliceTestClient.httpBackend, inboundGroupSessionPromise),
698705
]);
699706
});
700707
});
@@ -750,14 +757,19 @@ describe("megolm", () => {
750757
d.verified = DeviceInfo.DeviceVerification.VERIFIED;
751758
aliceTestClient.client.crypto?.deviceList.storeDevicesForUser("@bob:xyz", { DEVICE_ID: d });
752759

760+
const inboundGroupSessionPromise = expectSendRoomKey(
761+
aliceTestClient.httpBackend,
762+
"@bob:xyz",
763+
testOlmAccount,
764+
p2pSession,
765+
);
766+
753767
logger.log("Asking alice to re-send");
754768
await Promise.all([
755-
expectSendKeyAndMessage(aliceTestClient.httpBackend, "@bob:xyz", testOlmAccount, p2pSession).then(
756-
(decrypted) => {
757-
expect(decrypted.type).toEqual("m.room.message");
758-
expect(decrypted.content!.body).toEqual("test");
759-
},
760-
),
769+
expectSendMegolmMessage(aliceTestClient.httpBackend, inboundGroupSessionPromise).then((decrypted) => {
770+
expect(decrypted.type).toEqual("m.room.message");
771+
expect(decrypted.content!.body).toEqual("test");
772+
}),
761773
aliceTestClient.client.sendTextMessage(ROOM_ID, "test"),
762774
]);
763775
});

0 commit comments

Comments
 (0)