@@ -9,6 +9,7 @@ import { TaskBuilder } from '../TestingTools/TaskBuilder';
9
9
import { verifyMarkdownForDocs } from '../TestingTools/VerifyMarkdown' ;
10
10
import { parseAndEvaluateExpression } from '../../src/Scripting/TaskExpression' ;
11
11
import { MarkdownTable } from '../../src/lib/MarkdownTable' ;
12
+ import { makeQueryContextWithTasks } from '../../src/Scripting/QueryContext' ;
12
13
import { addBackticks , determineExpressionType , formatToRepresentType } from './ScriptingTestHelpers' ;
13
14
14
15
window . moment = moment ;
@@ -20,9 +21,10 @@ describe('task', () => {
20
21
const markdownTable = new MarkdownTable ( [ 'Field' , 'Type 1' , 'Example 1' , 'Type 2' , 'Example 2' ] ) ;
21
22
const task1 = TaskBuilder . createFullyPopulatedTask ( ) ;
22
23
const task2 = new TaskBuilder ( ) . description ( 'minimal task' ) . status ( Status . makeInProgress ( ) ) . build ( ) ;
24
+ const queryContext = makeQueryContextWithTasks ( task1 . path , [ task1 , task2 ] ) ;
23
25
for ( const field of fields ) {
24
- const value1 = parseAndEvaluateExpression ( task1 , field , undefined ) ;
25
- const value2 = parseAndEvaluateExpression ( task2 , field , undefined ) ;
26
+ const value1 = parseAndEvaluateExpression ( task1 , field , queryContext ) ;
27
+ const value2 = parseAndEvaluateExpression ( task2 , field , queryContext ) ;
26
28
const cells = [
27
29
addBackticks ( field ) ,
28
30
addBackticks ( determineExpressionType ( value1 ) ) ,
@@ -96,6 +98,8 @@ describe('task', () => {
96
98
// force line break
97
99
'task.id' ,
98
100
'task.blockedBy' ,
101
+ 'task.isBlocked(query.allTasks)' ,
102
+ 'task.isBlocking(query.allTasks)' ,
99
103
] ) ;
100
104
} ) ;
101
105
0 commit comments