test: encrypt 15 more Rust tests

- chat::chat_tests::test_forward_group
- chat::chat_tests::test_resend_foreign_message_fails
- chat::chat_tests::test_resend_info_message_fails
- ephemeral::ephemeral_tests::test_ephemeral_timer_non_member
- receive_imf::receive_imf_tests::test_delayed_removal_is_ignored
- receive_imf::receive_imf_tests::test_dont_readd_with_normal_msg
- receive_imf::receive_imf_tests::test_dont_recreate_contacts_on_add_remove
- receive_imf::receive_imf_tests::test_member_left_does_not_create_chat
- receive_imf::receive_imf_tests::test_outgoing_private_reply_multidevice
- receive_imf::receive_imf_tests::test_recreate_member_list_on_missing_add_of_self
- receive_imf::receive_imf_tests::test_references
- receive_imf::receive_imf_tests::test_send_as_bot
- receive_imf::receive_imf_tests::test_unsigned_chat_group_hdr
- securejoin::securejoin_tests::test_unknown_sender
- webxdc::webxdc_tests::test_webxdc_reject_updates_from_non_groupmembers
This commit is contained in:
link2xt
2025-03-31 01:30:05 +00:00
committed by l
parent 8f3fc10625
commit ddc2f55a6f
6 changed files with 128 additions and 128 deletions

View File

@@ -1745,29 +1745,30 @@ async fn helper_send_receive_status_update(
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_webxdc_reject_updates_from_non_groupmembers() -> Result<()> {
let alice = TestContext::new_alice().await;
let bob = TestContext::new_bob().await;
let contact_bob = Contact::create(&alice, "Bob", "bob@example.net").await?;
let chat_id = create_group_chat(&alice, ProtectionStatus::Unprotected, "Group").await?;
add_contact_to_chat(&alice, chat_id, contact_bob).await?;
let instance = send_webxdc_instance(&alice, chat_id).await?;
let mut tcm = TestContextManager::new();
let alice = &tcm.alice().await;
let bob = &tcm.bob().await;
let contact_bob = alice.add_or_lookup_contact_id(bob).await;
let chat_id = create_group_chat(alice, ProtectionStatus::Unprotected, "Group").await?;
add_contact_to_chat(alice, chat_id, contact_bob).await?;
let instance = send_webxdc_instance(alice, chat_id).await?;
bob.recv_msg(&alice.pop_sent_msg().await).await;
let bob_instance = bob.get_last_msg().await;
Chat::load_from_db(&bob, bob_instance.chat_id)
Chat::load_from_db(bob, bob_instance.chat_id)
.await?
.id
.accept(&bob)
.accept(bob)
.await?;
let status = helper_send_receive_status_update(&bob, &alice, &bob_instance, &instance).await?;
let status = helper_send_receive_status_update(bob, alice, &bob_instance, &instance).await?;
assert_eq!(
status,
r#"[{"payload":7,"info":"i","summary":"s","serial":1,"max_serial":1}]"#
);
remove_contact_from_chat(&alice, chat_id, contact_bob).await?;
remove_contact_from_chat(alice, chat_id, contact_bob).await?;
alice.pop_sent_msg().await;
let status = helper_send_receive_status_update(&bob, &alice, &bob_instance, &instance).await?;
let status = helper_send_receive_status_update(bob, alice, &bob_instance, &instance).await?;
assert_eq!(
status,