File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
crates/matrix-sdk/src/room Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -455,4 +455,47 @@ mod tests {
455
455
assert_eq ! ( thread. in_reply_to. as_ref( ) . unwrap( ) . event_id, event_id) ;
456
456
assert ! ( thread. is_falling_back) ;
457
457
}
458
+
459
+ #[ async_test]
460
+ async fn test_reply_forwarding_thread_for_poll_start ( ) {
461
+ let thread_root = event_id ! ( "$thread_root" ) ;
462
+ let event_id = event_id ! ( "$thread_reply" ) ;
463
+ let own_user_id = user_id ! ( "@me:saucisse.bzh" ) ;
464
+
465
+ let mut cache = TestEventCache :: default ( ) ;
466
+ let f = EventFactory :: new ( ) ;
467
+
468
+ cache. events . insert (
469
+ event_id. to_owned ( ) ,
470
+ f. poll_start (
471
+ "would you rather… A) eat a pineapple pizza, B) drink pickle juice" ,
472
+ "would you rather…" ,
473
+ vec ! [ "eat a pineapple pizza" , "drink pickle juice" ] ,
474
+ )
475
+ . in_thread ( thread_root, thread_root)
476
+ . event_id ( event_id)
477
+ . sender ( own_user_id)
478
+ . into ( ) ,
479
+ ) ;
480
+
481
+ let content = RoomMessageEventContentWithoutRelation :: text_plain ( "the reply" ) ;
482
+
483
+ let reply_event = make_reply_event (
484
+ cache,
485
+ own_user_id,
486
+ content,
487
+ Reply {
488
+ event_id : event_id. into ( ) ,
489
+ enforce_thread : EnforceThread :: Threaded ( ReplyWithinThread :: No ) ,
490
+ } ,
491
+ )
492
+ . await
493
+ . unwrap ( ) ;
494
+
495
+ assert_let ! ( Some ( Relation :: Thread ( thread) ) = & reply_event. relates_to) ;
496
+
497
+ assert_eq ! ( thread. event_id, thread_root) ;
498
+ assert_eq ! ( thread. in_reply_to. as_ref( ) . unwrap( ) . event_id, event_id) ;
499
+ assert ! ( thread. is_falling_back) ;
500
+ }
458
501
}
You can’t perform that action at this time.
0 commit comments