@@ -186,8 +186,8 @@ impl TestContextManager {
186
186
msg,
187
187
to. name( )
188
188
) ) ;
189
- let chat = from. create_chat ( to) . await ;
190
- let sent = from. send_text ( chat . id , msg) . await ;
189
+ let chat_id = from. create_chat_id ( to) . await ;
190
+ let sent = from. send_text ( chat_id , msg) . await ;
191
191
to. recv_msg ( & sent) . await
192
192
}
193
193
@@ -852,14 +852,23 @@ impl TestContext {
852
852
Chat :: load_from_db ( & self . ctx , chat_id) . await . unwrap ( )
853
853
}
854
854
855
+ /// Creates or returns an existing 1:1 [`ChatId`] with another account.
856
+ ///
857
+ /// This first creates a contact by exporting a vCard from the `other`
858
+ /// and importing it into `self`,
859
+ /// then creates a 1:1 chat with this contact.
860
+ pub async fn create_chat_id ( & self , other : & TestContext ) -> ChatId {
861
+ let contact_id = self . add_or_lookup_contact_id ( other) . await ;
862
+ ChatId :: create_for_contact ( self , contact_id) . await . unwrap ( )
863
+ }
864
+
855
865
/// Creates or returns an existing 1:1 [`Chat`] with another account.
856
866
///
857
867
/// This first creates a contact by exporting a vCard from the `other`
858
868
/// and importing it into `self`,
859
869
/// then creates a 1:1 chat with this contact.
860
870
pub async fn create_chat ( & self , other : & TestContext ) -> Chat {
861
- let contact_id = self . add_or_lookup_contact_id ( other) . await ;
862
- let chat_id = ChatId :: create_for_contact ( self , contact_id) . await . unwrap ( ) ;
871
+ let chat_id = self . create_chat_id ( other) . await ;
863
872
Chat :: load_from_db ( self , chat_id) . await . unwrap ( )
864
873
}
865
874
0 commit comments