@@ -25,58 +25,33 @@ fn test_create_document_with_all_mention_types() {
2525 document. insert_block ( block, None ) . unwrap ( ) ;
2626
2727 // Build a rich delta with all mention types
28- let mut deltas = Vec :: new ( ) ;
29-
30- // Regular text
31- deltas. push ( TextDelta :: Inserted ( "Hello " . to_string ( ) , None ) ) ;
32-
33- // Person mention
34- deltas. push ( build_mention_person_delta (
35- "person_123" ,
36- "Alice" ,
37- & page_id,
38- Some ( & block_id) ,
39- None ,
40- ) ) ;
41-
42- // More text
43- deltas. push ( TextDelta :: Inserted ( "! Check " . to_string ( ) , None ) ) ;
44-
45- // Page mention
46- deltas. push ( build_mention_page_delta (
47- MentionPageType :: Page ,
48- "page_456" ,
49- Some ( "block_789" ) ,
50- None ,
51- ) ) ;
52-
53- // Text
54- deltas. push ( TextDelta :: Inserted ( " and " . to_string ( ) , None ) ) ;
55-
56- // Child page mention
57- deltas. push ( build_mention_page_delta (
58- MentionPageType :: ChildPage ,
59- "child_page_999" ,
60- None ,
61- None ,
62- ) ) ;
63-
64- // Text
65- deltas. push ( TextDelta :: Inserted ( " on " . to_string ( ) , None ) ) ;
66-
67- // Date mention with reminder
68- deltas. push ( build_mention_date_delta (
69- "2025-01-30T10:00:00Z" ,
70- Some ( "reminder_abc" ) ,
71- Some ( "atTimeOfEvent" ) ,
72- true ,
73- ) ) ;
74-
75- // Text
76- deltas. push ( TextDelta :: Inserted ( ". Link: " . to_string ( ) , None ) ) ;
77-
78- // External link mention
79- deltas. push ( build_mention_external_link_delta ( "https://appflowy.io" ) ) ;
28+ let deltas = vec ! [
29+ // Regular text
30+ TextDelta :: Inserted ( "Hello " . to_string( ) , None ) ,
31+ // Person mention
32+ build_mention_person_delta( "person_123" , "Alice" , & page_id, Some ( & block_id) , None ) ,
33+ // More text
34+ TextDelta :: Inserted ( "! Check " . to_string( ) , None ) ,
35+ // Page mention
36+ build_mention_page_delta( MentionPageType :: Page , "page_456" , Some ( "block_789" ) , None ) ,
37+ // Text
38+ TextDelta :: Inserted ( " and " . to_string( ) , None ) ,
39+ // Child page mention
40+ build_mention_page_delta( MentionPageType :: ChildPage , "child_page_999" , None , None ) ,
41+ // Text
42+ TextDelta :: Inserted ( " on " . to_string( ) , None ) ,
43+ // Date mention with reminder
44+ build_mention_date_delta(
45+ "2025-01-30T10:00:00Z" ,
46+ Some ( "reminder_abc" ) ,
47+ Some ( "atTimeOfEvent" ) ,
48+ true ,
49+ ) ,
50+ // Text
51+ TextDelta :: Inserted ( ". Link: " . to_string( ) , None ) ,
52+ // External link mention
53+ build_mention_external_link_delta( "https://appflowy.io" ) ,
54+ ] ;
8055
8156 // Apply deltas to document
8257 let delta_json = serde_json:: to_string ( & deltas) . unwrap ( ) ;
@@ -307,7 +282,7 @@ fn test_mention_data_enum() {
307282 date, include_time, ..
308283 } ) => {
309284 assert_eq ! ( date, "2025-01-30T10:00:00Z" ) ;
310- assert_eq ! ( include_time, false ) ;
285+ assert ! ( ! include_time) ;
311286 } ,
312287 _ => panic ! ( "Expected Date mention data" ) ,
313288 }
@@ -334,7 +309,7 @@ fn test_date_without_time() {
334309 reminder_option,
335310 } ) => {
336311 assert_eq ! ( date, "2025-01-30T00:00:00Z" ) ;
337- assert_eq ! ( include_time, false ) ;
312+ assert ! ( ! include_time) ;
338313 assert_eq ! ( reminder_id, None ) ;
339314 assert_eq ! ( reminder_option, None ) ;
340315 } ,
0 commit comments