@@ -374,7 +374,10 @@ async fn test_member_add_remove() -> Result<()> {
374
374
// Alice leaves the chat.
375
375
remove_contact_from_chat ( & alice, alice_chat_id, ContactId :: SELF ) . await ?;
376
376
let sent = alice. pop_sent_msg ( ) . await ;
377
- assert_eq ! ( sent. load_from_db( ) . await . get_text( ) , "You left." ) ;
377
+ assert_eq ! (
378
+ sent. load_from_db( ) . await . get_text( ) ,
379
+ stock_str:: msg_group_left_local( & alice, ContactId :: SELF ) . await
380
+ ) ;
378
381
379
382
Ok ( ( ) )
380
383
}
@@ -2934,19 +2937,19 @@ async fn test_broadcast_channel_protected_listid() -> Result<()> {
2934
2937
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
2935
2938
async fn test_leave_broadcast ( ) -> Result < ( ) > {
2936
2939
let mut tcm = TestContextManager :: new ( ) ;
2937
- let alice = tcm. alice ( ) . await ;
2938
- let bob = tcm. bob ( ) . await ;
2940
+ let alice = & tcm. alice ( ) . await ;
2941
+ let bob = & tcm. bob ( ) . await ;
2939
2942
2940
2943
tcm. section ( "Alice creates broadcast channel with Bob." ) ;
2941
- let alice_chat_id = create_broadcast ( & alice, "foo" . to_string ( ) ) . await ?;
2942
- let bob_contact = alice. add_or_lookup_contact ( & bob) . await . id ;
2943
- add_contact_to_chat ( & alice, alice_chat_id, bob_contact) . await ?;
2944
+ let alice_chat_id = create_broadcast ( alice, "foo" . to_string ( ) ) . await ?;
2945
+ let bob_contact = alice. add_or_lookup_contact ( bob) . await . id ;
2946
+ add_contact_to_chat ( alice, alice_chat_id, bob_contact) . await ?;
2944
2947
2945
2948
tcm. section ( "Alice sends first message to broadcast." ) ;
2946
2949
let sent_msg = alice. send_text ( alice_chat_id, "Hello!" ) . await ;
2947
2950
let bob_msg = bob. recv_msg ( & sent_msg) . await ;
2948
2951
2949
- assert_eq ! ( get_chat_contacts( & alice, alice_chat_id) . await ?. len( ) , 1 ) ;
2952
+ assert_eq ! ( get_chat_contacts( alice, alice_chat_id) . await ?. len( ) , 1 ) ;
2950
2953
2951
2954
// Clear events so that we can later check
2952
2955
// that the 'Broadcast channel left' message didn't trigger IncomingMsg:
@@ -2957,13 +2960,13 @@ async fn test_leave_broadcast() -> Result<()> {
2957
2960
2958
2961
tcm. section ( "Bob leaves the broadcast channel." ) ;
2959
2962
let bob_chat_id = bob_msg. chat_id ;
2960
- bob_chat_id. accept ( & bob) . await ?;
2961
- remove_contact_from_chat ( & bob, bob_chat_id, ContactId :: SELF ) . await ?;
2963
+ bob_chat_id. accept ( bob) . await ?;
2964
+ remove_contact_from_chat ( bob, bob_chat_id, ContactId :: SELF ) . await ?;
2962
2965
2963
2966
let leave_msg = bob. pop_sent_msg ( ) . await ;
2964
2967
alice. recv_msg_trash ( & leave_msg) . await ;
2965
2968
2966
- assert_eq ! ( get_chat_contacts( & alice, alice_chat_id) . await ?. len( ) , 0 ) ;
2969
+ assert_eq ! ( get_chat_contacts( alice, alice_chat_id) . await ?. len( ) , 0 ) ;
2967
2970
2968
2971
alice. emit_event ( EventType :: Test ) ;
2969
2972
alice
0 commit comments