test: clarify feishu streaming status assertions

This commit is contained in:
Peter Steinberger
2026-05-08 09:01:04 +01:00
parent 09f83bfec0
commit 69c1487e0b

View File

@@ -1138,7 +1138,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {
const updateTexts = streamingInstances[0].update.mock.calls.map((call: unknown[]) =>
typeof call[0] === "string" ? call[0] : "",
);
expect(updateTexts.some((text) => text.includes("🔎 Web Search"))).toBe(true);
expect(updateTexts).toEqual(expect.arrayContaining([expect.stringContaining("🔎 Web Search")]));
expect(streamingInstances[0].close).toHaveBeenCalledWith("final answer", {
note: "Agent: agent",
});
@@ -1171,9 +1171,11 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {
const updateTexts = streamingInstances[0].update.mock.calls.map((call: unknown[]) =>
typeof call[0] === "string" ? call[0] : "",
);
expect(
updateTexts.some((text) => text.includes("🛠️ Exec: run tests, `pnpm test -- --watch=false`")),
).toBe(true);
expect(updateTexts).toEqual(
expect.arrayContaining([
expect.stringContaining("🛠️ Exec: run tests, `pnpm test -- --watch=false`"),
]),
);
});
it("omits message-like tools from streaming card status", async () => {
@@ -1199,7 +1201,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {
const updateTexts = streamingInstances[0].update.mock.calls.map((call: unknown[]) =>
typeof call[0] === "string" ? call[0] : "",
);
expect(updateTexts.some((text) => text.includes("Message"))).toBe(false);
expect(updateTexts).not.toEqual(expect.arrayContaining([expect.stringContaining("Message")]));
});
it("does not suppress a later final after error closeout", async () => {