@@ -759,32 +759,51 @@ async fn test_lookup_id_by_addr() {
759759async fn test_contact_get_color ( ) -> Result < ( ) > {
760760 let t = TestContext :: new ( ) . await ;
761761 let contact_id =
Contact :: create ( & t
, "name" , "[email protected] " ) . await ?
; 762- let color1 = Contact :: get_by_id ( & t, contact_id) . await ?. get_color ( ) ;
762+ let color1 = Contact :: get_by_id ( & t, contact_id)
763+ . await ?
764+ . get_color ( & t)
765+ . await ?;
763766 assert_eq ! ( color1, 0x4844e2 ) ;
764767
765768 let t = TestContext :: new ( ) . await ;
766769 let contact_id =
Contact :: create ( & t
, "prename name" , "[email protected] " ) . await ?
; 767- let color2 = Contact :: get_by_id ( & t, contact_id) . await ?. get_color ( ) ;
770+ let color2 = Contact :: get_by_id ( & t, contact_id)
771+ . await ?
772+ . get_color ( & t)
773+ . await ?;
768774 assert_eq ! ( color2, color1) ;
769775
770776 let t = TestContext :: new ( ) . await ;
771777 let contact_id =
Contact :: create ( & t
, "Name" , "[email protected] " ) . await ?
; 772- let color3 = Contact :: get_by_id ( & t, contact_id) . await ?. get_color ( ) ;
778+ let color3 = Contact :: get_by_id ( & t, contact_id)
779+ . await ?
780+ . get_color ( & t)
781+ . await ?;
773782 assert_eq ! ( color3, color1) ;
774783 Ok ( ( ) )
775784}
776785
777786#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
778- async fn test_self_color_vs_key ( ) -> Result < ( ) > {
787+ async fn test_self_color ( ) -> Result < ( ) > {
779788 let mut tcm = TestContextManager :: new ( ) ;
780789 let t = & tcm. unconfigured ( ) . await ;
781790 t
. configure_addr ( "[email protected] " ) . await ; 782791 assert ! ( t. is_configured( ) . await ?) ;
783- let color = Contact :: get_by_id ( t, ContactId :: SELF ) . await ?. get_color ( ) ;
784- assert_eq ! ( color, 0x808080 ) ;
792+ let color = Contact :: get_by_id ( t, ContactId :: SELF )
793+ . await ?
794+ . get_color ( t)
795+ . await ?;
796+ assert_ne ! ( color, 0x808080 ) ;
785797 get_securejoin_qr ( t, None ) . await ?;
786- let color1 = Contact :: get_by_id ( t, ContactId :: SELF ) . await ?. get_color ( ) ;
787- assert_ne ! ( color1, color) ;
798+ let color1 = Contact :: get_by_id ( t, ContactId :: SELF )
799+ . await ?
800+ . get_color ( t)
801+ . await ?;
802+ assert_eq ! ( color1, color) ;
803+
804+ let bob = & tcm. bob ( ) . await ;
805+ let contact = bob. add_or_lookup_contact ( t) . await ;
806+ assert_eq ! ( contact. get_color( bob) . await ?, color) ;
788807 Ok ( ( ) )
789808}
790809
0 commit comments