Skip to content

Commit 5b8fc42

Browse files
Add WorkspaceTodos materialize test for spec progress.
Covers checklist population when PATCH sets tasks_md on an empty checklist. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent b74d8af commit 5b8fc42

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

tests/spec/test_progress.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,28 @@ def test_import_agent_plan_merges_done_into_preserved_tasks_md():
171171
assert "REQ-001" in item.tasks_md
172172
assert item.checklist[0].done is True
173173
assert len(item.checklist) == 2
174+
175+
176+
def test_workspace_todos_update_materializes_checklist(tmp_path: Path):
177+
from cecli.spec.todos import WorkspaceTodos
178+
179+
api = WorkspaceTodos(tmp_path)
180+
store = api.load()
181+
item = TodoItem(
182+
id="t1",
183+
title="Feature",
184+
tasks_md="",
185+
checklist=[],
186+
created_at=_now_iso(),
187+
updated_at=_now_iso(),
188+
)
189+
store.todos.append(item)
190+
api.save(store)
191+
192+
updated, _ = api.update(
193+
item.id,
194+
tasks_md="- [ ] 1. Scaffold lib/ (depends: none)\n- [x] 2. Add tests\n",
195+
)
196+
assert len(updated.checklist) == 2
197+
assert updated.checklist[0].done is False
198+
assert updated.checklist[1].done is True

0 commit comments

Comments
 (0)