Skip to content

Commit 2628ed3

Browse files
committed
test: add test with mixed groups
1 parent cab21d6 commit 2628ed3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/TaskGroups.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ describe('Grouping tasks', () => {
230230
`);
231231
});
232232

233-
it('should create nested headings if multiple groups used', () => {
233+
it('should create nested headings if multiple groups used even if one is reversed', () => {
234234
// Arrange
235235
const t1 = fromLine({
236236
line: '- [ ] Task 1 - but path is 2nd, alphabetically',
@@ -246,21 +246,14 @@ describe('Grouping tasks', () => {
246246
});
247247
const tasks = [t1, t2, t3];
248248

249-
const grouping: Grouper[] = [new FolderField().createGrouper(), new FilenameField().createGrouper()];
249+
const grouping: Grouper[] = [new FolderField().createGrouper(true), new FilenameField().createGrouper()];
250250

251251
// Act
252252
const groups = new TaskGroups(grouping, tasks);
253253

254254
// Assert
255255
expect(groups.toString()).toMatchInlineSnapshot(`
256256
"
257-
Group names: [folder\\_a/folder\\_b/,[[file_c]]]
258-
#### folder\\_a/folder\\_b/
259-
##### [[file_c]]
260-
- [ ] Task 3 - but path is 1st, alphabetically
261-
262-
---
263-
264257
Group names: [folder\\_b/folder\\_c/,[[file_c]]]
265258
#### folder\\_b/folder\\_c/
266259
##### [[file_c]]
@@ -274,6 +267,13 @@ describe('Grouping tasks', () => {
274267
275268
---
276269
270+
Group names: [folder\\_a/folder\\_b/,[[file_c]]]
271+
#### folder\\_a/folder\\_b/
272+
##### [[file_c]]
273+
- [ ] Task 3 - but path is 1st, alphabetically
274+
275+
---
276+
277277
3 tasks
278278
"
279279
`);

0 commit comments

Comments
 (0)