test(tui): finalize sub-turn regression tests to stop pinned spinner

The two new sub-turn shrink regression tests created a pinned
DynamicBorder (via message_update with pinnable text + tool) but never
emitted message_end, so the spinner's setInterval kept the test process
alive until CI timed out after 15 minutes. Append a message_end to
each test so the module-level pinnedBorder is torn down.
This commit is contained in:
Jeremy 2026-04-13 20:36:52 -05:00
parent 03b7142400
commit 2bf2313395

View file

@ -758,6 +758,9 @@ test("chat-controller freezes prior sub-turn and appends new segments when conte
assert.equal(host.chatContainer.children.length, 5, "new tool appends after new text-run");
assert.equal(host.chatContainer.children[4]?.constructor?.name, "ToolExecutionComponent");
assert.notEqual(host.chatContainer.children[4], priorT1, "new T2 must be a different component from prior T1");
// Finalize so the module-level pinned spinner (setInterval) is torn down and the test process can exit.
await handleAgentEvent(host, { type: "message_end", message: makeAssistant([{ type: "text", text: "C" }, t2]) } as any);
});
// Regression: after a sub-turn shrink, lastPinnedText must be cleared so the
@ -806,4 +809,7 @@ test("chat-controller updates pinned zone after sub-turn shrink", async () => {
// Pinned markdown must now reflect the new sub-turn's text, not stay frozen on "first".
assert.equal((pinnedMarkdown as any)?.text, "second", "pinned zone must update after sub-turn shrink (#4144 regression)");
// Finalize so the module-level pinned spinner (setInterval) is torn down and the test process can exit.
await handleAgentEvent(host, { type: "message_end", message: makeAssistant([{ type: "text", text: "second" }, t2]) } as any);
});