mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 09:04:44 +00:00
test: count final tag reply callbacks
This commit is contained in:
@@ -27,7 +27,7 @@ describe("subscribeEmbeddedPiSession", () => {
|
||||
emit({ type: "message_start", message: { role: "assistant" } });
|
||||
emitAssistantTextDelta({ emit, delta: "<final>Hi there</final>" });
|
||||
|
||||
expect(onPartialReply).toHaveBeenCalled();
|
||||
expect(onPartialReply).toHaveBeenCalledTimes(1);
|
||||
const firstPayload = onPartialReply.mock.calls[0][0];
|
||||
expect(firstPayload.text).toBe("Hi there");
|
||||
|
||||
@@ -76,7 +76,7 @@ describe("subscribeEmbeddedPiSession", () => {
|
||||
emit({ type: "message_start", message: { role: "assistant" } });
|
||||
emitAssistantTextDelta({ emit, delta: "<final>Hello world</final>" });
|
||||
|
||||
expect(onPartialReply).toHaveBeenCalled();
|
||||
expect(onPartialReply).toHaveBeenCalledTimes(1);
|
||||
expect(onPartialReply.mock.calls[0][0].text).toBe("Hello world");
|
||||
});
|
||||
|
||||
@@ -269,7 +269,7 @@ describe("subscribeEmbeddedPiSession", () => {
|
||||
emit({ type: "message_end", message: assistantMessage });
|
||||
await Promise.resolve();
|
||||
|
||||
expect(onBlockReply).toHaveBeenCalled();
|
||||
expect(onBlockReply).toHaveBeenCalledTimes(1);
|
||||
const payload = onBlockReply.mock.calls[0][0];
|
||||
expect(payload.text).toBe("Hello block");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user