mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
test that 'You added' appears only one own devices
This commit is contained in:
29
src/chat.rs
29
src/chat.rs
@@ -5345,6 +5345,35 @@ mod tests {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
|
async fn test_info_message_wording() -> Result<()> {
|
||||||
|
let alice = TestContext::new_alice().await;
|
||||||
|
let alice_grp = create_group_chat(&alice, ProtectionStatus::Unprotected, "grp").await?;
|
||||||
|
add_contact_to_chat(
|
||||||
|
&alice,
|
||||||
|
alice_grp,
|
||||||
|
Contact::create(&alice, "", "bob@example.net").await?,
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
alice.send_text(alice_grp, "alice->bob").await;
|
||||||
|
add_contact_to_chat(
|
||||||
|
&alice,
|
||||||
|
alice_grp,
|
||||||
|
Contact::create(&alice, "", "claire@example.org").await?,
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
let sent2 = alice.pop_sent_msg().await;
|
||||||
|
let msg = Message::load_from_db(&alice, sent2.sender_msg_id).await?;
|
||||||
|
|
||||||
|
// For DC, info message reads "You added"; for non-DC MUA, info message should not read "You added"
|
||||||
|
let you_added = "You added";
|
||||||
|
assert!(msg.get_text().unwrap().contains(you_added));
|
||||||
|
assert!(!sent2.payload().contains(you_added));
|
||||||
|
assert!(sent2.payload().contains("added by"));
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
async fn test_can_send_group() -> Result<()> {
|
async fn test_can_send_group() -> Result<()> {
|
||||||
let alice = TestContext::new_alice().await;
|
let alice = TestContext::new_alice().await;
|
||||||
|
|||||||
Reference in New Issue
Block a user