Skip to content

Commit 9f25b94

Browse files
committed
test: - Test group.statement
1 parent f68ce86 commit 9f25b94

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/Query/Sort/Sorter.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { type Comparator, Sorter } from '../../../src/Query/Sort/Sorter';
22
import type { Task } from '../../../src/Task/Task';
33
import type { SearchInfo } from '../../../src/Query/SearchInfo';
4+
import { Statement } from '../../../src/Query/Statement';
45

56
describe('Sorter', () => {
67
const comparator: Comparator = (a: Task, b: Task, _searchInfo: SearchInfo) => {
@@ -13,4 +14,14 @@ describe('Sorter', () => {
1314
expect(sorter.instruction).toBe('sort by lineNumber');
1415
expect(sorter.statement.rawInstruction).toBe('sort by lineNumber');
1516
});
17+
18+
it('should store a Statement object', () => {
19+
const instruction = 'sort by lineNumber';
20+
const statement = new Statement(instruction, instruction);
21+
const sorter = new Sorter('sort by lineNumber', 'lineNumber', comparator, false);
22+
23+
sorter.setStatement(statement);
24+
25+
expect(sorter.statement.rawInstruction).toBe('sort by lineNumber');
26+
});
1627
});

0 commit comments

Comments
 (0)