Add basic test for ChatId.parent_is_encrypted()

This commit is contained in:
Alexander Krotov
2020-04-11 22:06:27 +03:00
committed by holger krekel
parent f51fd1267f
commit f65dbee74b

View File

@@ -3119,4 +3119,16 @@ mod tests {
false
);
}
#[test]
fn test_parent_is_encrypted() {
let t = dummy_context();
let chat_id = create_group_chat(&t.ctx, VerifiedStatus::Unverified, "foo").unwrap();
assert!(!chat_id.parent_is_encrypted(&t.ctx).unwrap());
let mut msg = Message::new(Viewtype::Text);
msg.set_text(Some("hello".to_string()));
chat_id.set_draft(&t.ctx, Some(&mut msg));
assert!(!chat_id.parent_is_encrypted(&t.ctx).unwrap());
}
}