@@ -692,9 +692,16 @@ describe("megolm", () => {
692
692
const room = aliceTestClient . client . getRoom ( ROOM_ID ) ! ;
693
693
const pendingMsg = room . getPendingEvents ( ) [ 0 ] ;
694
694
695
+ const inboundGroupSessionPromise = expectSendRoomKey (
696
+ aliceTestClient . httpBackend ,
697
+ "@bob:xyz" ,
698
+ testOlmAccount ,
699
+ p2pSession ,
700
+ ) ;
701
+
695
702
await Promise . all ( [
696
703
aliceTestClient . client . resendEvent ( pendingMsg , room ) ,
697
- expectSendKeyAndMessage ( aliceTestClient . httpBackend , "@bob:xyz" , testOlmAccount , p2pSession ) ,
704
+ expectSendMegolmMessage ( aliceTestClient . httpBackend , inboundGroupSessionPromise ) ,
698
705
] ) ;
699
706
} ) ;
700
707
} ) ;
@@ -750,14 +757,19 @@ describe("megolm", () => {
750
757
d . verified = DeviceInfo . DeviceVerification . VERIFIED ;
751
758
aliceTestClient . client . crypto ?. deviceList . storeDevicesForUser ( "@bob:xyz" , { DEVICE_ID : d } ) ;
752
759
760
+ const inboundGroupSessionPromise = expectSendRoomKey (
761
+ aliceTestClient . httpBackend ,
762
+ "@bob:xyz" ,
763
+ testOlmAccount ,
764
+ p2pSession ,
765
+ ) ;
766
+
753
767
logger . log ( "Asking alice to re-send" ) ;
754
768
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
+ } ) ,
761
773
aliceTestClient . client . sendTextMessage ( ROOM_ID , "test" ) ,
762
774
] ) ;
763
775
} ) ;
0 commit comments