mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 15:26:30 +03:00
add failing test for #5418 (wrong DC_EVENT_REACTIONS_CHANGED)
This commit is contained in:
@@ -310,7 +310,7 @@ pub async fn get_msg_reactions(context: &Context, msg_id: MsgId) -> Result<React
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::chat::get_chat_msgs;
|
use crate::chat::{get_chat_msgs, send_text_msg};
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::constants::DC_CHAT_ID_TRASH;
|
use crate::constants::DC_CHAT_ID_TRASH;
|
||||||
use crate::contact::{Contact, ContactAddress, Origin};
|
use crate::contact::{Contact, ContactAddress, Origin};
|
||||||
@@ -653,4 +653,25 @@ Here's my footer -- bob@example.net"
|
|||||||
);
|
);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
|
async fn test_send_reaction_multidevice() -> Result<()> {
|
||||||
|
let alice0 = TestContext::new_alice().await;
|
||||||
|
let alice1 = TestContext::new_alice().await;
|
||||||
|
let bob_id = Contact::create(&alice0, "", "bob@example.net").await?;
|
||||||
|
let chat_id = ChatId::create_for_contact(&alice0, bob_id).await?;
|
||||||
|
|
||||||
|
let alice0_msg_id = send_text_msg(&alice0, chat_id, "foo".to_string()).await?;
|
||||||
|
let alice1_msg = alice1.recv_msg(&alice0.pop_sent_msg().await).await;
|
||||||
|
|
||||||
|
send_reaction(&alice0, alice0_msg_id, "👀").await?;
|
||||||
|
let sync = alice0.pop_sent_msg().await;
|
||||||
|
receive_imf(&alice1, sync.payload().as_bytes(), false).await?;
|
||||||
|
|
||||||
|
expect_reactions_changed_event(&alice0, chat_id, alice0_msg_id, ContactId::SELF).await?;
|
||||||
|
expect_reactions_changed_event(&alice1, alice1_msg.chat_id, alice1_msg.id, ContactId::SELF)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user