Skip to content

Commit ddda591

Browse files
committed
test: call Grouper directly
1 parent 5cfa4cc commit ddda591

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/TaskGroups.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import moment from 'moment';
55
import { FilenameField } from '../src/Query/Filter/FilenameField';
6-
import { Grouper, type GrouperFunction } from '../src/Query/Grouper';
6+
import type { Grouper } from '../src/Query/Grouper';
77
import type { Task } from '../src/Task';
88
import { PathField } from '../src/Query/Filter/PathField';
99
import { TagsField } from '../src/Query/Filter/TagsField';
@@ -251,8 +251,7 @@ describe('Grouping tasks', () => {
251251
});
252252
const inputs = [a, b];
253253

254-
const groupByTags: GrouperFunction = (task: Task) => task.tags;
255-
const grouper = new Grouper('custom tag grouper', groupByTags, false);
254+
const grouper = new TagsField().createNormalGrouper();
256255
const groups = new TaskGroups([grouper], inputs);
257256

258257
expect(groups.totalTasksCount()).toEqual(2);
@@ -264,15 +263,16 @@ describe('Grouping tasks', () => {
264263

265264
expect(groups.toString()).toMatchInlineSnapshot(`
266265
"Groupers (if any):
267-
- custom tag grouper
266+
- tags
268267
269-
Group names: []
268+
Group names: [(No tags)]
269+
#### [tags] (No tags)
270270
- [ ] Task without a tag
271271
272272
---
273273
274274
Group names: [#group1]
275-
#### [custom tag grouper] #group1
275+
#### [tags] #group1
276276
- [ ] Task with a tag #group1
277277
278278
---

0 commit comments

Comments
 (0)