Skip to content

Commit

Permalink
test: add failing test for #6489
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Jan 30, 2025
1 parent 0df042a commit b40a1ee
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/receive_imf/receive_imf_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5551,3 +5551,28 @@ async fn test_default_member_timestamps_to_zero() -> Result<()> {
assert_eq!(chat::get_chat_contacts(bob, chat.id).await?.len(), 3);
Ok(())
}

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_two_group_securejoins() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = &tcm.alice().await;
let bob = &tcm.bob().await;
let fiona = &tcm.fiona().await;

let group_id = chat::create_group_chat(alice, ProtectionStatus::Protected, "Group").await?;

let qr = get_securejoin_qr(alice, Some(group_id)).await?;

// Bob joins using QR code.
tcm.exec_securejoin_qr(bob, alice, &qr).await;

// Fiona joins using QR code.
tcm.exec_securejoin_qr(fiona, alice, &qr).await;

let fiona_chat_id = fiona.get_last_msg().await.chat_id;
fiona
.golden_test_chat(fiona_chat_id, "two_group_securejoins")
.await;

Ok(())
}
9 changes: 9 additions & 0 deletions test-data/golden/two_group_securejoins
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Group#Chat#11: Group [3 member(s)] 🛡️
--------------------------------------------------------------------------------
Msg#11: info (Contact#Contact#Info): [email protected] invited you to join this group.

Waiting for the device of [email protected] to reply… [NOTICED][INFO]
Msg#13: info (Contact#Contact#Info): [email protected] replied, waiting for being added to the group… [NOTICED][INFO]
Msg#17: info (Contact#Contact#Info): Messages are guaranteed to be end-to-end encrypted from now on. [NOTICED][INFO 🛡️]
Msg#18🔒: (Contact#Contact#10): Member Me ([email protected]) added by [email protected]. [FRESH][INFO]
--------------------------------------------------------------------------------

0 comments on commit b40a1ee

Please sign in to comment.