@@ -404,7 +404,7 @@ mod tests {
404
404
use crate :: config:: Config ;
405
405
use crate :: contact:: { Contact , Origin } ;
406
406
use crate :: download:: DownloadState ;
407
- use crate :: message:: { MessageState , delete_msgs} ;
407
+ use crate :: message:: { MessageState , Viewtype , delete_msgs} ;
408
408
use crate :: receive_imf:: { receive_imf, receive_imf_from_inbox} ;
409
409
use crate :: sql:: housekeeping;
410
410
use crate :: test_utils:: E2EE_INFO_MSGS ;
550
550
let reactions = get_msg_reactions ( & alice, msg. id ) . await ?;
551
551
assert_eq ! ( reactions. to_string( ) , "😀1" ) ;
552
552
553
+ // Alice receives a message with reaction to her message from Bob.
554
+ let msg_bob = receive_imf (
555
+ & alice,
556
+
557
+
558
+ Date: Today, 29 February 2021 00:00:10 -800\n \
559
+
560
+
561
+ Mime-Version: 1.0\n \
562
+ Content-Type: multipart/mixed; boundary=\" YiEDa0DAkWCtVeE4\" \n \
563
+ Content-Disposition: inline\n \
564
+ \n \
565
+ --YiEDa0DAkWCtVeE4\n \
566
+ Content-Type: text/plain; charset=utf-8\n \
567
+ Content-Disposition: inline\n \
568
+ \n \
569
+ Reply + reaction\n \
570
+ \n \
571
+ --YiEDa0DAkWCtVeE4\n \
572
+ Content-Type: text/plain; charset=utf-8\n \
573
+ Content-Disposition: reaction\n \
574
+ \n \
575
+ \u{1F44D} \n \
576
+ \n \
577
+ --YiEDa0DAkWCtVeE4--"
578
+ . as_bytes ( ) ,
579
+ false ,
580
+ )
581
+ . await ?
582
+ . unwrap ( ) ;
583
+ let msg_bob = Message :: load_from_db ( & alice, msg_bob. msg_ids [ 0 ] ) . await ?;
584
+ assert_eq ! ( msg_bob. from_id, bob_id) ;
585
+ assert_eq ! ( msg_bob. chat_id, msg. chat_id) ;
586
+ assert_eq ! ( msg_bob. viewtype, Viewtype :: Text ) ;
587
+ assert_eq ! ( msg_bob. state, MessageState :: InFresh ) ;
588
+ assert_eq ! ( msg_bob. hidden, false ) ;
589
+ assert_eq ! ( msg_bob. text, "Reply + reaction" ) ;
590
+ let reactions = get_msg_reactions ( & alice, msg. id ) . await ?;
591
+ assert_eq ! ( reactions. to_string( ) , "👍1" ) ;
592
+
553
593
Ok ( ( ) )
554
594
}
555
595
0 commit comments