Skip to content

Commit

Permalink
test: Auto-generated non-chat message is non-bot
Browse files Browse the repository at this point in the history
  • Loading branch information
iequidoo committed Dec 28, 2024
1 parent 740bd7a commit 5445310
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2752,6 +2752,25 @@ mod tests {
let contact = Contact::get_by_id(&alice, msg.from_id).await?;
assert!(!contact.is_bot());

// Alice receives an auto-generated non-chat message.
receive_imf(
&alice,
b"From: Claire <[email protected]>\n\
To: [email protected]\n\
Message-ID: <[email protected]>\n\
Auto-Submitted: auto-generated\n\
Date: Fri, 29 Jan 2021 21:37:55 +0000\n\
\n\
hello\n",
false,
)
.await?;
let msg = alice.get_last_msg().await;
assert_eq!(msg.get_text(), "hello".to_string());
assert!(!msg.is_bot());
let contact = Contact::get_by_id(&alice, msg.from_id).await?;
assert!(!contact.is_bot());

Ok(())
}

Expand Down

0 comments on commit 5445310

Please sign in to comment.