@@ -13,18 +13,10 @@ describe('parsing', () => {
13
13
it ( 'parses a task from a line' , ( ) => {
14
14
// Arrange
15
15
const line = '- [x] this is a done task 🗓 2021-09-12 ✅ 2021-06-20' ;
16
- const path = 'this/is a path/to a/file.md' ;
17
- const sectionStart = 1337 ;
18
- const sectionIndex = 1209 ;
19
- const precedingHeader = 'Eloquent Section' ;
20
16
21
17
// Act
22
- const task = Task . fromLine ( {
18
+ const task = fromLine ( {
23
19
line,
24
- path,
25
- sectionStart,
26
- sectionIndex,
27
- precedingHeader,
28
20
} ) ;
29
21
30
22
// Assert
@@ -46,18 +38,10 @@ describe('parsing', () => {
46
38
const originalSettings = getSettings ( ) ;
47
39
updateSettings ( { globalFilter : '#task' } ) ;
48
40
const line = '- [x] this is a done task 🗓 2021-09-12 ✅ 2021-06-20' ;
49
- const path = 'this/is a path/to a/file.md' ;
50
- const sectionStart = 1337 ;
51
- const sectionIndex = 1209 ;
52
- const precedingHeader = 'Eloquent Section' ;
53
41
54
42
// Act
55
- const task = Task . fromLine ( {
43
+ const task = fromLine ( {
56
44
line,
57
- path,
58
- sectionStart,
59
- sectionIndex,
60
- precedingHeader,
61
45
} ) ;
62
46
63
47
// Assert
@@ -70,18 +54,10 @@ describe('parsing', () => {
70
54
it ( 'allows signifier emojis as part of the description' , ( ) => {
71
55
// Arrange
72
56
const line = '- [x] this is a ✅ done task 🗓 2021-09-12 ✅ 2021-06-20' ;
73
- const path = 'this/is a path/to a/file.md' ;
74
- const sectionStart = 1337 ;
75
- const sectionIndex = 1209 ;
76
- const precedingHeader = 'Eloquent Section' ;
77
57
78
58
// Act
79
- const task = Task . fromLine ( {
59
+ const task = fromLine ( {
80
60
line,
81
- path,
82
- sectionStart,
83
- sectionIndex,
84
- precedingHeader,
85
61
} ) ;
86
62
87
63
// Assert
@@ -102,18 +78,10 @@ describe('parsing', () => {
102
78
// Arrange
103
79
const line =
104
80
'- [x] this is a ✅ done task 🗓 2021-09-12 ✅ 2021-06-20 ^my-precious ' ;
105
- const path = 'this/is a path/to a/file.md' ;
106
- const sectionStart = 1337 ;
107
- const sectionIndex = 1209 ;
108
- const precedingHeader = 'Eloquent Section' ;
109
81
110
82
// Act
111
- const task = Task . fromLine ( {
83
+ const task = fromLine ( {
112
84
line,
113
- path,
114
- sectionStart,
115
- sectionIndex,
116
- precedingHeader,
117
85
} ) ;
118
86
119
87
// Assert
@@ -314,12 +282,8 @@ describe('to string', () => {
314
282
const line = '- [ ] this is a task 📅 2021-09-12 ^my-precious' ;
315
283
316
284
// Act
317
- const task : Task = Task . fromLine ( {
285
+ const task : Task = fromLine ( {
318
286
line,
319
- path : '' ,
320
- sectionStart : 0 ,
321
- sectionIndex : 0 ,
322
- precedingHeader : '' ,
323
287
} ) as Task ;
324
288
325
289
// Assert
@@ -333,12 +297,8 @@ describe('to string', () => {
333
297
'- [x] this is a done task #tagone 📅 2021-09-12 ✅ 2021-06-20 #journal/daily' ;
334
298
335
299
// Act
336
- const task : Task = Task . fromLine ( {
300
+ const task : Task = fromLine ( {
337
301
line,
338
- path : '' ,
339
- sectionStart : 0 ,
340
- sectionIndex : 0 ,
341
- precedingHeader : '' ,
342
302
} ) as Task ;
343
303
344
304
// Assert
@@ -354,12 +314,8 @@ describe('toggle done', () => {
354
314
const line = '- [ ] this is a task 📅 2021-09-12 ^my-precious' ;
355
315
356
316
// Act
357
- const task : Task = Task . fromLine ( {
317
+ const task : Task = fromLine ( {
358
318
line,
359
- path : '' ,
360
- sectionStart : 0 ,
361
- sectionIndex : 0 ,
362
- precedingHeader : '' ,
363
319
} ) as Task ;
364
320
const toggled : Task = task . toggle ( ) [ 0 ] ;
365
321
@@ -614,12 +570,8 @@ describe('toggle done', () => {
614
570
. filter ( Boolean )
615
571
. join ( ' ' ) ;
616
572
617
- const task = Task . fromLine ( {
573
+ const task = fromLine ( {
618
574
line,
619
- path : '' ,
620
- precedingHeader : '' ,
621
- sectionStart : 0 ,
622
- sectionIndex : 0 ,
623
575
} ) ;
624
576
625
577
const nextTask : Task = task ! . toggle ( ) [ 0 ] ;
@@ -643,18 +595,10 @@ describe('toggle done', () => {
643
595
it ( 'supports recurrence rule after a due date' , ( ) => {
644
596
// Arrange
645
597
const line = '- [ ] this is a task 🗓 2021-09-12 🔁 every day' ;
646
- const path = 'this/is a path/to a/file.md' ;
647
- const sectionStart = 1337 ;
648
- const sectionIndex = 1209 ;
649
- const precedingHeader = 'Eloquent Section' ;
650
598
651
599
// Act
652
- const task = Task . fromLine ( {
600
+ const task = fromLine ( {
653
601
line,
654
- path,
655
- sectionStart,
656
- sectionIndex,
657
- precedingHeader,
658
602
} ) ;
659
603
660
604
// Assert
0 commit comments