MCPcopy Create free account
hub / github.com/chatmail/core / test_delete_webxdc_instance

Function test_delete_webxdc_instance

src/webxdc/webxdc_tests.rs:335–365  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

333
334#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
335async fn test_delete_webxdc_instance() -> Result<()> {
336 let t = TestContext::new_alice().await;
337 let chat_id = create_group(&t, "foo").await?;
338 let instance = send_webxdc_instance(&t, chat_id).await?;
339 let now = tools::time();
340 t.receive_status_update(
341 ContactId::SELF,
342 &instance,
343 now,
344 true,
345 r#"{"updates":[{"payload":1}]}"#,
346 )
347 .await?;
348 assert_eq!(
349 t.sql
350 .count("SELECT COUNT(*) FROM msgs_status_updates;", ())
351 .await?,
352 1
353 );
354
355 message::delete_msgs(&t, &[instance.id]).await?;
356 sql::housekeeping(&t).await?;
357 assert_eq!(
358 t.sql
359 .count("SELECT COUNT(*) FROM msgs_status_updates;", ())
360 .await?,
361 0
362 );
363
364 Ok(())
365}
366
367#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
368async fn test_delete_chat_with_webxdc() -> Result<()> {

Callers

nothing calls this directly

Calls 6

send_webxdc_instanceFunction · 0.85
timeFunction · 0.85
delete_msgsFunction · 0.85
housekeepingFunction · 0.85
receive_status_updateMethod · 0.80
create_groupFunction · 0.50

Tested by

no test coverage detected