@@ -776,9 +776,17 @@ async fn test_make_reply_event_doesnt_require_event_cache() {
776
776
async fn test_start_live_location_share_for_room ( ) {
777
777
let ( client, server) = logged_in_client_with_server ( ) . await ;
778
778
779
+ // Validate request body and response, partial body matching due to auto-generated
780
+ // `org.matrix.msc3488.ts`
779
781
Mock :: given ( method ( "PUT" ) )
780
782
. and ( path_regex ( r"^/_matrix/client/r0/rooms/.*/state/org.matrix.msc3672.beacon_info/.*" ) )
781
783
. and ( header ( "authorization" , "Bearer 1234" ) )
784
+ . and ( body_partial_json ( & json ! ( {
785
+ "description" : "Live Share" ,
786
+ "live" : true ,
787
+ "timeout" : 3000 ,
788
+ "org.matrix.msc3488.asset" : { "type" : "m.self" }
789
+ } ) ) )
782
790
. respond_with ( ResponseTemplate :: new ( 200 ) . set_body_json ( & * test_json:: EVENT_ID ) )
783
791
. mount ( & server)
784
792
. await ;
@@ -787,7 +795,7 @@ async fn test_start_live_location_share_for_room() {
787
795
788
796
mock_sync ( & server, & * test_json:: SYNC , None ) . await ;
789
797
790
- let _response = client. sync_once ( sync_settings. clone ( ) ) . await . unwrap ( ) ;
798
+ client. sync_once ( sync_settings. clone ( ) ) . await . unwrap ( ) ;
791
799
792
800
let room = client. get_room ( & DEFAULT_TEST_ROOM_ID ) . unwrap ( ) ;
793
801
@@ -834,7 +842,7 @@ async fn test_start_live_location_share_for_room() {
834
842
)
835
843
. await ;
836
844
837
- let _response = client. sync_once ( sync_settings. clone ( ) ) . await . unwrap ( ) ;
845
+ client. sync_once ( sync_settings. clone ( ) ) . await . unwrap ( ) ;
838
846
server. reset ( ) . await ;
839
847
840
848
let state_events = room. get_state_events ( StateEventType :: BeaconInfo ) . await . unwrap ( ) ;
@@ -867,9 +875,17 @@ async fn test_start_live_location_share_for_room() {
867
875
async fn test_stop_sharing_live_location ( ) {
868
876
let ( client, server) = logged_in_client_with_server ( ) . await ;
869
877
878
+ // Validate request body and response, partial body matching due to auto-generated
879
+ // `org.matrix.msc3488.ts`
870
880
Mock :: given ( method ( "PUT" ) )
871
881
. and ( path_regex ( r"^/_matrix/client/r0/rooms/.*/state/org.matrix.msc3672.beacon_info/.*" ) )
872
882
. and ( header ( "authorization" , "Bearer 1234" ) )
883
+ . and ( body_partial_json ( & json ! ( {
884
+ "description" : "Live Share" ,
885
+ "live" : false ,
886
+ "timeout" : 3000 ,
887
+ "org.matrix.msc3488.asset" : { "type" : "m.self" }
888
+ } ) ) )
873
889
. respond_with ( ResponseTemplate :: new ( 200 ) . set_body_json ( & * test_json:: EVENT_ID ) )
874
890
. mount ( & server)
875
891
. await ;
@@ -913,7 +929,7 @@ async fn test_stop_sharing_live_location() {
913
929
)
914
930
. await ;
915
931
916
- let _response = client. sync_once ( sync_settings. clone ( ) ) . await . unwrap ( ) ;
932
+ client. sync_once ( sync_settings. clone ( ) ) . await . unwrap ( ) ;
917
933
918
934
let room = client. get_room ( & DEFAULT_TEST_ROOM_ID ) . unwrap ( ) ;
919
935
@@ -959,7 +975,7 @@ async fn test_stop_sharing_live_location() {
959
975
)
960
976
. await ;
961
977
962
- let _response = client. sync_once ( sync_settings. clone ( ) ) . await . unwrap ( ) ;
978
+ client. sync_once ( sync_settings. clone ( ) ) . await . unwrap ( ) ;
963
979
server. reset ( ) . await ;
964
980
965
981
let state_events = room. get_state_events ( StateEventType :: BeaconInfo ) . await . unwrap ( ) ;
0 commit comments