generated from coulomb/repo-seed
Improve dashboard loading and task sync
This commit is contained in:
@@ -145,6 +145,39 @@ class TestParseTaskBlocks:
|
||||
assert len(tasks) == 1
|
||||
assert tasks[0]["id"] == "T01"
|
||||
|
||||
def test_extracts_markdown_after_task_block_as_description(self):
|
||||
body = (
|
||||
"### T01 — Configure registry\n\n"
|
||||
"```task\nid: T01\nstatus: todo\npriority: high\n```\n\n"
|
||||
"Update `app.ini` so packages are enabled.\n\n"
|
||||
"```ini\n[packages]\nENABLED = true\n```\n\n"
|
||||
"**Done when:** a rendered config contains the package settings.\n\n"
|
||||
"---\n\n"
|
||||
"### T02 — Next task\n\n"
|
||||
"```task\nid: T02\nstatus: todo\n```\n"
|
||||
)
|
||||
tasks = parse_task_blocks(body)
|
||||
assert tasks[0]["description"] == (
|
||||
"Update `app.ini` so packages are enabled.\n\n"
|
||||
"```ini\n[packages]\nENABLED = true\n```\n\n"
|
||||
"**Done when:** a rendered config contains the package settings."
|
||||
)
|
||||
assert "Next task" not in tasks[0]["description"]
|
||||
|
||||
def test_keeps_nested_headings_inside_task_description(self):
|
||||
body = (
|
||||
"## T01\n\n"
|
||||
"```task\nid: T01\nstatus: todo\n```\n\n"
|
||||
"Intro.\n\n"
|
||||
"### Notes\n\n"
|
||||
"- Keep this nested heading in the task content.\n\n"
|
||||
"## T02\n\n"
|
||||
"```task\nid: T02\nstatus: todo\n```\n"
|
||||
)
|
||||
tasks = parse_task_blocks(body)
|
||||
assert "### Notes" in tasks[0]["description"]
|
||||
assert "## T02" not in tasks[0]["description"]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# get_tasks_from_workplan
|
||||
|
||||
Reference in New Issue
Block a user