@@ -373,7 +373,10 @@ async fn test_member_add_remove() -> Result<()> {
373
373
// Alice leaves the chat.
374
374
remove_contact_from_chat ( & alice, alice_chat_id, ContactId :: SELF ) . await ?;
375
375
let sent = alice. pop_sent_msg ( ) . await ;
376
- assert_eq ! ( sent. load_from_db( ) . await . get_text( ) , "You left." ) ;
376
+ assert_eq ! (
377
+ sent. load_from_db( ) . await . get_text( ) ,
378
+ stock_str:: msg_group_left_local( & alice, ContactId :: SELF ) . await
379
+ ) ;
377
380
378
381
Ok ( ( ) )
379
382
}
@@ -2892,19 +2895,19 @@ async fn test_block_broadcast() -> Result<()> {
2892
2895
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
2893
2896
async fn test_leave_broadcast ( ) -> Result < ( ) > {
2894
2897
let mut tcm = TestContextManager :: new ( ) ;
2895
- let alice = tcm. alice ( ) . await ;
2896
- let bob = tcm. bob ( ) . await ;
2898
+ let alice = & tcm. alice ( ) . await ;
2899
+ let bob = & tcm. bob ( ) . await ;
2897
2900
2898
2901
tcm. section ( "Alice creates broadcast channel with Bob." ) ;
2899
- let alice_chat_id = create_broadcast ( & alice, "foo" . to_string ( ) ) . await ?;
2900
- let bob_contact = alice. add_or_lookup_contact ( & bob) . await . id ;
2901
- add_contact_to_chat ( & alice, alice_chat_id, bob_contact) . await ?;
2902
+ let alice_chat_id = create_broadcast ( alice, "foo" . to_string ( ) ) . await ?;
2903
+ let bob_contact = alice. add_or_lookup_contact ( bob) . await . id ;
2904
+ add_contact_to_chat ( alice, alice_chat_id, bob_contact) . await ?;
2902
2905
2903
2906
tcm. section ( "Alice sends first message to broadcast." ) ;
2904
2907
let sent_msg = alice. send_text ( alice_chat_id, "Hello!" ) . await ;
2905
2908
let bob_msg = bob. recv_msg ( & sent_msg) . await ;
2906
2909
2907
- assert_eq ! ( get_chat_contacts( & alice, alice_chat_id) . await ?. len( ) , 1 ) ;
2910
+ assert_eq ! ( get_chat_contacts( alice, alice_chat_id) . await ?. len( ) , 1 ) ;
2908
2911
2909
2912
// Clear events so that we can later check
2910
2913
// that the 'Broadcast channel left' message didn't trigger IncomingMsg:
@@ -2915,13 +2918,13 @@ async fn test_leave_broadcast() -> Result<()> {
2915
2918
2916
2919
tcm. section ( "Bob leaves the broadcast channel." ) ;
2917
2920
let bob_chat_id = bob_msg. chat_id ;
2918
- bob_chat_id. accept ( & bob) . await ?;
2919
- remove_contact_from_chat ( & bob, bob_chat_id, ContactId :: SELF ) . await ?;
2921
+ bob_chat_id. accept ( bob) . await ?;
2922
+ remove_contact_from_chat ( bob, bob_chat_id, ContactId :: SELF ) . await ?;
2920
2923
2921
2924
let leave_msg = bob. pop_sent_msg ( ) . await ;
2922
2925
alice. recv_msg_trash ( & leave_msg) . await ;
2923
2926
2924
- assert_eq ! ( get_chat_contacts( & alice, alice_chat_id) . await ?. len( ) , 0 ) ;
2927
+ assert_eq ! ( get_chat_contacts( alice, alice_chat_id) . await ?. len( ) , 0 ) ;
2925
2928
2926
2929
alice. emit_event ( EventType :: Test ) ;
2927
2930
alice
0 commit comments