mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
Improve testing, remove debugging println! statements
This commit is contained in:
@@ -1159,7 +1159,6 @@ fn create_or_lookup_mailinglist(
|
|||||||
);
|
);
|
||||||
ChatId::new(0)
|
ChatId::new(0)
|
||||||
});
|
});
|
||||||
println!("err: new chatid {:?}", chat_id);
|
|
||||||
Ok((chat_id, create_blocked))
|
Ok((chat_id, create_blocked))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1767,12 +1766,21 @@ mod tests {
|
|||||||
\n\
|
\n\
|
||||||
hello\n";
|
hello\n";
|
||||||
|
|
||||||
|
static MAILINGLIST2: &[u8] = b"From: Github <notifications@github.com>\n\
|
||||||
|
To: deltachat/deltachat-core-rust <deltachat-core-rust@noreply.github.com>\n\
|
||||||
|
Subject: [deltachat/deltachat-core-rust] PR run failed\n\
|
||||||
|
Message-ID: <3334@example.org>\n\
|
||||||
|
List-ID: deltachat/deltachat-core-rust <deltachat-core-rust.deltachat.github.com>\n\
|
||||||
|
Precedence: list\n\
|
||||||
|
Date: Sun, 22 Mar 2020 22:37:57 +0000\n\
|
||||||
|
\n\
|
||||||
|
hello back\n";
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_mailing_list() {
|
fn test_mailing_list() {
|
||||||
println!("testing");
|
|
||||||
|
|
||||||
let t = configured_offline_context();
|
let t = configured_offline_context();
|
||||||
t.ctx.set_config(Config::ShowEmails, Some("2")).unwrap();
|
t.ctx.set_config(Config::ShowEmails, Some("2")).unwrap();
|
||||||
|
|
||||||
dc_receive_imf(&t.ctx, MAILINGLIST, "INBOX", 1, false).unwrap();
|
dc_receive_imf(&t.ctx, MAILINGLIST, "INBOX", 1, false).unwrap();
|
||||||
|
|
||||||
let chats = Chatlist::try_load(&t.ctx, 0, None, None).unwrap();
|
let chats = Chatlist::try_load(&t.ctx, 0, None, None).unwrap();
|
||||||
@@ -1783,6 +1791,11 @@ mod tests {
|
|||||||
assert_eq!(chat.can_send(), false);
|
assert_eq!(chat.can_send(), false);
|
||||||
assert_eq!(chat.name, "deltachat/deltachat-core-rust");
|
assert_eq!(chat.name, "deltachat/deltachat-core-rust");
|
||||||
assert_eq!(chat::get_chat_contacts(&t.ctx, chat_id).len(), 0);
|
assert_eq!(chat::get_chat_contacts(&t.ctx, chat_id).len(), 0);
|
||||||
|
|
||||||
|
dc_receive_imf(&t.ctx, MAILINGLIST2, "INBOX", 1, false).unwrap();
|
||||||
|
|
||||||
|
let chats = Chatlist::try_load(&t.ctx, 0, None, None).unwrap();
|
||||||
|
assert_eq!(chats.len(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user