* fix(feishu): non-blocking ws ack and preserve streaming card full content * fix(feishu): preserve fragmented streaming text without newline artifacts --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
19 lines
750 B
TypeScript
19 lines
750 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { mergeStreamingText } from "./streaming-card.js";
|
|
|
|
describe("mergeStreamingText", () => {
|
|
it("prefers the latest full text when it already includes prior text", () => {
|
|
expect(mergeStreamingText("hello", "hello world")).toBe("hello world");
|
|
});
|
|
|
|
it("keeps previous text when the next partial is empty or redundant", () => {
|
|
expect(mergeStreamingText("hello", "")).toBe("hello");
|
|
expect(mergeStreamingText("hello world", "hello")).toBe("hello world");
|
|
});
|
|
|
|
it("appends fragmented chunks without injecting newlines", () => {
|
|
expect(mergeStreamingText("hello wor", "ld")).toBe("hello world");
|
|
expect(mergeStreamingText("line1", "line2")).toBe("line1line2");
|
|
});
|
|
});
|