mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
Add basic test for ChatId.parent_is_encrypted()
This commit is contained in:
committed by
holger krekel
parent
f51fd1267f
commit
f65dbee74b
12
src/chat.rs
12
src/chat.rs
@@ -3119,4 +3119,16 @@ mod tests {
|
|||||||
false
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user