mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
test: Protected group for bot is auto-accepted
This commit is contained in:
@@ -3275,6 +3275,24 @@ async fn test_auto_accept_group_for_bots() -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
|
async fn test_auto_accept_protected_group_for_bots() -> Result<()> {
|
||||||
|
let mut tcm = TestContextManager::new();
|
||||||
|
let alice = &tcm.alice().await;
|
||||||
|
let bob = &tcm.bob().await;
|
||||||
|
bob.set_config(Config::Bot, Some("1")).await.unwrap();
|
||||||
|
mark_as_verified(alice, bob).await;
|
||||||
|
mark_as_verified(bob, alice).await;
|
||||||
|
let group_id = alice
|
||||||
|
.create_group_with_members(ProtectionStatus::Protected, "Group", &[bob])
|
||||||
|
.await;
|
||||||
|
let sent = alice.send_text(group_id, "Hello!").await;
|
||||||
|
let msg = bob.recv_msg(&sent).await;
|
||||||
|
let chat = chat::Chat::load_from_db(bob, msg.chat_id).await?;
|
||||||
|
assert!(!chat.is_contact_request());
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
async fn test_send_as_bot() -> Result<()> {
|
async fn test_send_as_bot() -> Result<()> {
|
||||||
let mut tcm = TestContextManager::new();
|
let mut tcm = TestContextManager::new();
|
||||||
|
|||||||
Reference in New Issue
Block a user