extract-tasks-body.test.mjs
29 lines 1.1 KB
Raw
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd feat(calendar): enforce agent context tiers in retrieval AP… Human minor ⚠ breaking 1 day ago
1 /**
2 * Unit tests for `extractCheckboxTasksFromBody` (shared local + hosted).
3 */
4
5 import { describe, it } from 'node:test';
6 import assert from 'node:assert/strict';
7 import { extractCheckboxTasksFromBody } from '../lib/extract-tasks.mjs';
8
9 describe('extractCheckboxTasksFromBody', () => {
10 it('parses open and done lines with path and line numbers', () => {
11 const body = 'intro\n- [ ] Open item\n - [x] Done item\n';
12 const all = extractCheckboxTasksFromBody(body, { path: 'n.md', status: 'all' });
13 assert.equal(all.length, 2);
14 assert.deepEqual(
15 all.map((t) => ({ text: t.text, line: t.line, status: t.status, path: t.path })),
16 [
17 { text: 'Open item', line: 2, status: 'open', path: 'n.md' },
18 { text: 'Done item', line: 3, status: 'done', path: 'n.md' },
19 ]
20 );
21 });
22
23 it('respects status filter', () => {
24 const body = '- [ ] A\n- [x] B\n';
25 const openOnly = extractCheckboxTasksFromBody(body, { path: 'p.md', status: 'open' });
26 assert.equal(openOnly.length, 1);
27 assert.equal(openOnly[0].text, 'A');
28 });
29 });
File History 2 commits
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd feat(calendar): enforce agent context tiers in retrieval AP… Human minor 1 day ago
sha256:9103f98c89257ed2b01c237cea895dabb3e85ea337dccb1161c175e4422355b6 docs: accept Calendar Events v0 spec with Phase 0 security … Human 1 day ago