@@ -6,7 +6,8 @@ use std::time::Duration;
66
77use super :: * ;
88use crate :: chat:: {
9- self , ChatId , add_contact_to_chat, create_group, remove_contact_from_chat, send_text_msg,
9+ self , ChatId , add_contact_to_chat, create_group, create_group_unencrypted,
10+ remove_contact_from_chat, send_text_msg,
1011} ;
1112use crate :: chatlist:: Chatlist ;
1213use crate :: constants;
@@ -351,7 +352,7 @@ async fn test_subject_in_group() -> Result<()> {
351352 let mut tcm = TestContextManager :: new ( ) ;
352353 let t = tcm. alice ( ) . await ;
353354 let bob = tcm. bob ( ) . await ;
354- let group_id = chat :: create_group ( & t, "groupname" ) . await . unwrap ( ) ;
355+ let group_id = create_group ( & t, "groupname" ) . await . unwrap ( ) ;
355356 let bob_contact_id = t. add_or_lookup_contact_id ( & bob) . await ;
356357 chat:: add_contact_to_chat ( & t, group_id, bob_contact_id) . await ?;
357358
@@ -671,15 +672,20 @@ async fn test_selfavatar_unencrypted_signed() {
671672async fn test_remove_member_bcc ( ) -> Result < ( ) > {
672673 let mut tcm = TestContextManager :: new ( ) ;
673674
674- // Alice creates a group with Bob and Claire and then removes Bob.
675+ // Alice creates a group with Bob and Charlie and then removes Charlie.
676+
675677 let alice = & tcm. alice ( ) . await ;
676678 let bob = & tcm. bob ( ) . await ;
677679 let charlie = & tcm. charlie ( ) . await ;
678680
679- let bob_id = alice. add_or_lookup_contact_id ( bob) . await ;
680- let charlie_id = alice. add_or_lookup_contact_id ( charlie) . await ;
681+ let alice_addr = alice. get_config ( Config :: Addr ) . await ?. unwrap ( ) ;
682+ let bob_addr = bob. get_config ( Config :: Addr ) . await ?. unwrap ( ) ;
683+ let charlie_addr = charlie. get_config ( Config :: Addr ) . await ?. unwrap ( ) ;
684+
685+ let bob_id = alice. add_or_lookup_address_contact_id ( bob) . await ;
686+ let charlie_id = alice. add_or_lookup_address_contact_id ( charlie) . await ;
681687
682- let alice_chat_id = create_group ( alice, "foo" ) . await ?;
688+ let alice_chat_id = create_group_unencrypted ( alice, "foo" ) . await ?;
683689 add_contact_to_chat ( alice, alice_chat_id, bob_id) . await ?;
684690 add_contact_to_chat ( alice, alice_chat_id, charlie_id) . await ?;
685691 send_text_msg ( alice, alice_chat_id, "Creating a group" . to_string ( ) ) . await ?;
@@ -696,11 +702,12 @@ async fn test_remove_member_bcc() -> Result<()> {
696702 for to_addr in to. iter ( ) {
697703 match to_addr {
698704 mailparse:: MailAddr :: Single ( info) => {
699- panic ! ( "Single addresses are not expected here: {info:?}" ) ;
705+ // Addresses should be of existing members and not Charlie.
706+ assert_ne ! ( info. addr, charlie_addr) ;
707+ assert ! ( info. addr == alice_addr || info. addr == bob_addr) ;
700708 }
701- mailparse:: MailAddr :: Group ( info) => {
702- assert_eq ! ( info. group_name, "hidden-recipients" ) ;
703- assert_eq ! ( info. addrs, [ ] ) ;
709+ mailparse:: MailAddr :: Group ( _) => {
710+ panic ! ( "Group addresses are not expected here" ) ;
704711 }
705712 }
706713 }
0 commit comments