@@ -12,6 +12,7 @@ use crate::chatlist::Chatlist;
12
12
use crate :: config:: Config ;
13
13
use crate :: download:: DownloadState ;
14
14
use crate :: ephemeral;
15
+ use crate :: message:: delete_msgs;
15
16
use crate :: receive_imf:: { receive_imf, receive_imf_from_inbox} ;
16
17
use crate :: test_utils:: { E2EE_INFO_MSGS , TestContext , TestContextManager } ;
17
18
use crate :: tools:: { self , SystemTime } ;
@@ -1616,6 +1617,26 @@ async fn test_webxdc_info_msg_no_cleanup_on_interrupted_series() -> Result<()> {
1616
1617
Ok ( ( ) )
1617
1618
}
1618
1619
1620
+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
1621
+ async fn test_webxdc_info_msg_delete ( ) -> Result < ( ) > {
1622
+ let t = TestContext :: new_alice ( ) . await ;
1623
+ let chat_id = create_group_chat ( & t, ProtectionStatus :: Unprotected , "c" ) . await ?;
1624
+ let instance = send_webxdc_instance ( & t, chat_id) . await ?;
1625
+
1626
+ t. send_webxdc_status_update ( instance. id , r#"{"info":"i1", "payload":1}"# )
1627
+ . await ?;
1628
+ assert_eq ! ( chat_id. get_msg_cnt( & t) . await ?, 2 ) ;
1629
+ send_text_msg ( & t, chat_id, "msg between info" . to_string ( ) ) . await ?;
1630
+ assert_eq ! ( chat_id. get_msg_cnt( & t) . await ?, 3 ) ;
1631
+ t. send_webxdc_status_update ( instance. id , r#"{"info":"i2", "payload":2}"# )
1632
+ . await ?;
1633
+ assert_eq ! ( chat_id. get_msg_cnt( & t) . await ?, 4 ) ;
1634
+ delete_msgs ( & t, & [ instance. id ] ) . await ?;
1635
+ assert_eq ! ( chat_id. get_msg_cnt( & t) . await ?, 1 ) ;
1636
+
1637
+ Ok ( ( ) )
1638
+ }
1639
+
1619
1640
// check that `info.internet_access` is not set for normal, non-integrated webxdc -
1620
1641
// even if they use the deprecated option `request_internet_access` in manifest.toml
1621
1642
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
0 commit comments