@@ -11,7 +11,7 @@ describe('Api', function()
11
11
' DEADLINE: <2021-07-21 Wed 22:02>' ,
12
12
' ** TODO Second level :NESTEDTAG:' ,
13
13
' DEADLINE: <2021-07-21 Wed 22:02>' ,
14
- ' * DONE Some task' ,
14
+ ' * DONE Some task :ARCHIVE: ' ,
15
15
' DEADLINE: <2021-07-21 Wed 22:02>' ,
16
16
' Unrelated date <2022-06-11 Sat 23:15>' ,
17
17
})
@@ -22,6 +22,7 @@ describe('Api', function()
22
22
assert .are .same (file , current_file .filename )
23
23
assert .are .same (current_file .category , vim .fn .fnamemodify (file , ' :p:t:r' ))
24
24
assert .are .same (3 , # current_file .headlines )
25
+ assert .are .same (1 , current_file .headlines [1 ].level )
25
26
assert .are .same (' Test orgmode' , current_file .headlines [1 ].title )
26
27
assert .are .same (' * TODO Test orgmode :WORK:OFFICE:' , current_file .headlines [1 ].line )
27
28
assert .are .same ({ ' WORK' , ' OFFICE' }, current_file .headlines [1 ].all_tags )
@@ -38,7 +39,9 @@ describe('Api', function()
38
39
assert .Is .Nil (current_file .headlines [1 ].scheduled )
39
40
assert .Is .Nil (current_file .headlines [1 ].closed )
40
41
assert .are .same ({}, current_file .headlines [1 ].dates )
42
+ assert .Is .False (current_file .headlines [1 ].is_archived )
41
43
44
+ assert .are .same (2 , current_file .headlines [2 ].level )
42
45
assert .are .same (' Second level' , current_file .headlines [2 ].title )
43
46
assert .are .same (0 , # current_file .headlines [2 ].headlines )
44
47
assert .are .same ({ ' WORK' , ' OFFICE' , ' NESTEDTAG' }, current_file .headlines [2 ].all_tags )
@@ -49,12 +52,14 @@ describe('Api', function()
49
52
assert .are .same (1 , current_file .headlines [2 ].position .start_col )
50
53
assert .are .same (6 , current_file .headlines [2 ].position .end_line )
51
54
assert .are .same (0 , current_file .headlines [2 ].position .end_col )
55
+ assert .Is .False (current_file .headlines [2 ].is_archived )
52
56
assert .are .same (current_file .headlines [1 ], current_file .headlines [2 ].parent )
53
57
58
+ assert .are .same (1 , current_file .headlines [3 ].level )
54
59
assert .are .same (' Some task' , current_file .headlines [3 ].title )
55
60
assert .are .same (0 , # current_file .headlines [3 ].headlines )
56
- assert .are .same ({}, current_file .headlines [3 ].all_tags )
57
- assert .are .same ({}, current_file .headlines [3 ].tags )
61
+ assert .are .same ({ ' ARCHIVE ' }, current_file .headlines [3 ].all_tags )
62
+ assert .are .same ({ ' ARCHIVE ' }, current_file .headlines [3 ].tags )
58
63
assert .are .same (' DONE' , current_file .headlines [3 ].todo_value )
59
64
assert .are .same (' DONE' , current_file .headlines [3 ].todo_type )
60
65
assert .are .same (7 , current_file .headlines [3 ].position .start_line )
@@ -65,6 +70,7 @@ describe('Api', function()
65
70
assert .are .same (' 2021-07-21 Wed 22:02' , current_file .headlines [3 ].deadline :to_string ())
66
71
assert .Is .Nil (current_file .headlines [3 ].scheduled )
67
72
assert .Is .Nil (current_file .headlines [3 ].closed )
73
+ assert .Is .True (current_file .headlines [3 ].is_archived )
68
74
assert .are .same (1 , # current_file .headlines [3 ].dates )
69
75
assert .are .same (' 2022-06-11 Sat 23:15' , current_file .headlines [3 ].dates [1 ]:to_string ())
70
76
end )
0 commit comments