From 6ff3a2cf7c43cc3428eb57a78b9d0e1f02937484 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Tue, 2 Apr 2024 00:29:24 +0200 Subject: [PATCH] add failing test for #5418 (wrong DC_EVENT_REACTIONS_CHANGED) --- src/reaction.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/reaction.rs b/src/reaction.rs index 892803322..15ac3a355 100644 --- a/src/reaction.rs +++ b/src/reaction.rs @@ -310,7 +310,7 @@ pub async fn get_msg_reactions(context: &Context, msg_id: MsgId) -> Result 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(()) + } }