@@ -574,9 +574,16 @@ describe("megolm", () => {
574
574
const room = aliceTestClient . client . getRoom ( ROOM_ID ) ! ;
575
575
const pendingMsg = room . getPendingEvents ( ) [ 0 ] ;
576
576
577
+ const inboundGroupSessionPromise = expectSendRoomKey (
578
+ aliceTestClient . httpBackend ,
579
+ "@bob:xyz" ,
580
+ testOlmAccount ,
581
+ p2pSession ,
582
+ ) ;
583
+
577
584
await Promise . all ( [
578
585
aliceTestClient . client . resendEvent ( pendingMsg , room ) ,
579
- expectSendKeyAndMessage ( aliceTestClient . httpBackend , "@bob:xyz" , testOlmAccount , p2pSession ) ,
586
+ expectSendMegolmMessage ( aliceTestClient . httpBackend , inboundGroupSessionPromise ) ,
580
587
] ) ;
581
588
} ) ;
582
589
} ) ;
@@ -632,14 +639,19 @@ describe("megolm", () => {
632
639
d . verified = DeviceInfo . DeviceVerification . VERIFIED ;
633
640
aliceTestClient . client . crypto ?. deviceList . storeDevicesForUser ( "@bob:xyz" , { DEVICE_ID : d } ) ;
634
641
642
+ const inboundGroupSessionPromise = expectSendRoomKey (
643
+ aliceTestClient . httpBackend ,
644
+ "@bob:xyz" ,
645
+ testOlmAccount ,
646
+ p2pSession ,
647
+ ) ;
648
+
635
649
logger . log ( "Asking alice to re-send" ) ;
636
650
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
+ } ) ,
643
655
aliceTestClient . client . sendTextMessage ( ROOM_ID , "test" ) ,
644
656
] ) ;
645
657
} ) ;
0 commit comments