File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -473,4 +473,5 @@ module.exports = {
473
473
addDependency,
474
474
fetchTaskByIssueId,
475
475
fetchPaginatedTasks,
476
+ getBuiltTasks,
476
477
} ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const { expect } = chai;
9
9
const cleanDb = require ( "../../utils/cleanDb" ) ;
10
10
const tasksData = require ( "../../fixtures/tasks/tasks" ) ( ) ;
11
11
const tasks = require ( "../../../models/tasks" ) ;
12
- const { addDependency, updateTask } = require ( "../../../models/tasks" ) ;
12
+ const { addDependency, updateTask, getBuiltTasks } = require ( "../../../models/tasks" ) ;
13
13
const firestore = require ( "../../../utils/firestore" ) ;
14
14
const { TASK_STATUS } = require ( "../../../constants/tasks" ) ;
15
15
const dependencyModel = firestore . collection ( "TaskDependencies" ) ;
@@ -91,6 +91,14 @@ describe("tasks", function () {
91
91
expect ( task ) . to . contain . all . keys ( sameTask ) ;
92
92
} ) ;
93
93
} ) ;
94
+ it ( "should fetch tasks filtered by search term" , async function ( ) {
95
+ const searchTerm = "task" ;
96
+ const tasksSnapshot = await tasksModel . get ( ) ;
97
+ const result = await getBuiltTasks ( tasksSnapshot , searchTerm ) ;
98
+ result . forEach ( ( task ) => {
99
+ expect ( task . title . toLowerCase ( ) ) . to . include ( searchTerm . toLowerCase ( ) ) ;
100
+ } ) ;
101
+ } ) ;
94
102
} ) ;
95
103
96
104
describe ( "paginatedTasks" , function ( ) {
You can’t perform that action at this time.
0 commit comments