mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 02:11:23 +00:00
refactor: streamline TUI stream assembly updates
This commit is contained in:
@@ -65,4 +65,29 @@ describe("TuiStreamAssembler", () => {
|
||||
|
||||
expect(finalText).toBe("Streamed");
|
||||
});
|
||||
|
||||
it("returns null when delta text is unchanged", () => {
|
||||
const assembler = new TuiStreamAssembler();
|
||||
const first = assembler.ingestDelta(
|
||||
"run-4",
|
||||
{
|
||||
role: "assistant",
|
||||
content: [{ type: "text", text: "Repeat" }],
|
||||
},
|
||||
false,
|
||||
);
|
||||
|
||||
expect(first).toBe("Repeat");
|
||||
|
||||
const second = assembler.ingestDelta(
|
||||
"run-4",
|
||||
{
|
||||
role: "assistant",
|
||||
content: [{ type: "text", text: "Repeat" }],
|
||||
},
|
||||
false,
|
||||
);
|
||||
|
||||
expect(second).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user