Skip to content

Commit 4bef5f8

Browse files
committed
test(webview): pin the restore's partial-flag half from its own output
What: the "still streams if a restored text row is left partial" case now builds its input by running the restore and putting `partial` back, instead of hand-writing the same message the `it.each` arm already covers. Why: the hand-written input was byte-identical to the `text` arm of the streaming `it.each`, so the case asserted a duplicate of a shape already pinned and never exercised the restore path it is named for. Deriving the input from the restore output keeps the `partial: false` half pinned to the code that clears it. Impact: test-only. The case still fails when the restore leaves `partial` set, and now also fails when the restore drops the row instead of re-adding it.
1 parent 38d242e commit 4bef5f8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎webview-ui/src/components/chat/__tests__/ChatView.resume-strip-not-streaming.spec.tsx‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,15 @@ describe("ChatView - resume strip leaves a non-streaming chat", () => {
305305
it("still streams if a restored text row is left partial", async () => {
306306
// Guards the `partial: false` half of the restore: keeping the row without
307307
// clearing the flag would reintroduce exactly the #257 lock the strip removes.
308-
renderWithMessages([taskMessage, { type: "say", say: "text", ts: 2, text: "Half a sentence", partial: true }])
308+
// The input is the restore's own output with the flag put back, so this case
309+
// stays pinned to the restore path instead of repeating the `text` arm above.
310+
const partialTail: ClineMessage = { type: "say", say: "text", ts: 2, text: "Half a sentence", partial: true }
311+
const restored = applyHostResumeStrip([taskMessage, partialTail], ["Half a sentence"])
312+
const leftPartial = restored.map((message) =>
313+
message.say === "text" ? { ...message, partial: true } : message,
314+
)
315+
316+
renderWithMessages(leftPartial)
309317

310318
await expectStreaming(true)
311319
})

0 commit comments

Comments
 (0)