diff options
Diffstat (limited to 'spec/test_progress.lua')
| -rw-r--r-- | spec/test_progress.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/test_progress.lua b/spec/test_progress.lua index 5788998..76cd289 100644 --- a/spec/test_progress.lua +++ b/spec/test_progress.lua @@ -76,6 +76,36 @@ return { assert(pins.b[2] == false, "reset safely releases unresolved boards") end }, + { "background workflows keep their board pinned after the outer tool settles", function() + progress.reset() + progress.begin_live_turn() + local component, pins + progress.claim({ + id = "background-call", + tool_name = "subagents.lua", + set_component = function(_, value) + component, pins = value, {} + return { + alive = function() return true end, + invalidate = function() end, + set_pinned = function(_, value) pins[#pins + 1] = value end, + } + end, + }) + + progress.bind({ tool_call_id = "background-call" }) + progress.card("worker", "child") + progress.workflow_started("background-call") + progress.settle({ id = "background-call" }) + progress.reset() + assert(#pins == 1 and pins[1] == true, "turn boundaries must not unpin a running workflow") + assert(component:render(80)[#component:render(80)] == "", "a running workflow retains its spacing") + + progress.workflow_finished("background-call") + assert(#pins == 2 and pins[2] == false, "the board unpins when its final workflow settles") + progress.reset() + end }, + { "a pinned board leaves one blank line before the waiting indicator", function() progress.reset() local component, pins |
