@@ -5,9 +5,7 @@ use std::str;
55use std:: time:: Duration ;
66
77use super :: * ;
8- use crate :: chat:: {
9- self , ChatId , add_contact_to_chat, create_group, remove_contact_from_chat, send_text_msg,
10- } ;
8+ use crate :: chat:: { self , ChatId , add_contact_to_chat, remove_contact_from_chat, send_text_msg} ;
119use crate :: chatlist:: Chatlist ;
1210use crate :: constants;
1311use crate :: contact:: Origin ;
@@ -671,15 +669,20 @@ async fn test_selfavatar_unencrypted_signed() {
671669async fn test_remove_member_bcc ( ) -> Result < ( ) > {
672670 let mut tcm = TestContextManager :: new ( ) ;
673671
674- // Alice creates a group with Bob and Claire and then removes Bob.
672+ // Alice creates a group with Bob and Charlie and then removes Charlie.
673+
675674 let alice = & tcm. alice ( ) . await ;
676675 let bob = & tcm. bob ( ) . await ;
677676 let charlie = & tcm. charlie ( ) . await ;
678677
679- let bob_id = alice. add_or_lookup_contact_id ( bob) . await ;
680- let charlie_id = alice. add_or_lookup_contact_id ( charlie) . await ;
678+ let alice_addr = alice. get_config ( Config :: Addr ) . await ?. unwrap ( ) ;
679+ let bob_addr = bob. get_config ( Config :: Addr ) . await ?. unwrap ( ) ;
680+ let charlie_addr = charlie. get_config ( Config :: Addr ) . await ?. unwrap ( ) ;
681+
682+ let bob_id = alice. add_or_lookup_address_contact_id ( bob) . await ;
683+ let charlie_id = alice. add_or_lookup_address_contact_id ( charlie) . await ;
681684
682- let alice_chat_id = create_group ( alice, "foo" ) . await ?;
685+ let alice_chat_id = chat :: create_group_unencrypted ( alice, "foo" ) . await ?;
683686 add_contact_to_chat ( alice, alice_chat_id, bob_id) . await ?;
684687 add_contact_to_chat ( alice, alice_chat_id, charlie_id) . await ?;
685688 send_text_msg ( alice, alice_chat_id, "Creating a group" . to_string ( ) ) . await ?;
@@ -696,11 +699,12 @@ async fn test_remove_member_bcc() -> Result<()> {
696699 for to_addr in to. iter ( ) {
697700 match to_addr {
698701 mailparse:: MailAddr :: Single ( info) => {
699- panic ! ( "Single addresses are not expected here: {info:?}" ) ;
702+ // Addresses should be of existing members and not Charlie.
703+ assert_ne ! ( info. addr, charlie_addr) ;
704+ assert ! ( info. addr == alice_addr || info. addr == bob_addr) ;
700705 }
701- mailparse:: MailAddr :: Group ( info) => {
702- assert_eq ! ( info. group_name, "hidden-recipients" ) ;
703- assert_eq ! ( info. addrs, [ ] ) ;
706+ mailparse:: MailAddr :: Group ( _) => {
707+ panic ! ( "Group addresses are not expected here" ) ;
704708 }
705709 }
706710 }
0 commit comments