mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 22:36:30 +03:00
test: use load_imf_email() more
This commit is contained in:
@@ -2875,9 +2875,8 @@ async fn test_rfc1847_encapsulation() -> Result<()> {
|
|||||||
|
|
||||||
// Alice sends a message to Bob using Thunderbird.
|
// Alice sends a message to Bob using Thunderbird.
|
||||||
let raw = include_bytes!("../../test-data/message/rfc1847_encapsulation.eml");
|
let raw = include_bytes!("../../test-data/message/rfc1847_encapsulation.eml");
|
||||||
receive_imf(bob, raw, false).await?;
|
|
||||||
|
|
||||||
let msg = bob.get_last_msg().await;
|
let msg = load_imf_email(bob, raw).await;
|
||||||
assert!(msg.get_showpadlock());
|
assert!(msg.get_showpadlock());
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -3085,8 +3084,8 @@ async fn test_auto_accept_for_bots() -> Result<()> {
|
|||||||
async fn test_auto_accept_group_for_bots() -> Result<()> {
|
async fn test_auto_accept_group_for_bots() -> Result<()> {
|
||||||
let t = TestContext::new_alice().await;
|
let t = TestContext::new_alice().await;
|
||||||
t.set_config(Config::Bot, Some("1")).await.unwrap();
|
t.set_config(Config::Bot, Some("1")).await.unwrap();
|
||||||
receive_imf(&t, GRP_MAIL, false).await?;
|
let msg = load_imf_email(&t, GRP_MAIL).await;
|
||||||
let msg = t.get_last_msg().await;
|
|
||||||
let chat = chat::Chat::load_from_db(&t, msg.chat_id).await?;
|
let chat = chat::Chat::load_from_db(&t, msg.chat_id).await?;
|
||||||
assert!(!chat.is_contact_request());
|
assert!(!chat.is_contact_request());
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -3559,9 +3558,9 @@ async fn test_messed_up_message_id() -> Result<()> {
|
|||||||
let t = TestContext::new_bob().await;
|
let t = TestContext::new_bob().await;
|
||||||
|
|
||||||
let raw = include_bytes!("../../test-data/message/messed_up_message_id.eml");
|
let raw = include_bytes!("../../test-data/message/messed_up_message_id.eml");
|
||||||
receive_imf(&t, raw, false).await?;
|
let msg = load_imf_email(&t, raw).await;
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
t.get_last_msg().await.rfc724_mid,
|
msg.rfc724_mid,
|
||||||
"0bb9ffe1-2596-d997-95b4-1fef8cc4808e@example.org"
|
"0bb9ffe1-2596-d997-95b4-1fef8cc4808e@example.org"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user