mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 14:20:42 +00:00
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveGoogleChatDurableReplyOptions } from "./monitor-durable.js";
|
|
|
|
describe("resolveGoogleChatDurableReplyOptions", () => {
|
|
it("enables durable final delivery when no typing preview is active", () => {
|
|
expect(
|
|
resolveGoogleChatDurableReplyOptions({
|
|
payload: { text: "hello", replyToId: "thread-1" },
|
|
infoKind: "final",
|
|
spaceId: "spaces/AAA",
|
|
}),
|
|
).toEqual({
|
|
to: "spaces/AAA",
|
|
replyToId: "thread-1",
|
|
threadId: "thread-1",
|
|
});
|
|
});
|
|
|
|
it("keeps typing preview delivery on the legacy edit path", () => {
|
|
expect(
|
|
resolveGoogleChatDurableReplyOptions({
|
|
payload: { text: "hello" },
|
|
infoKind: "final",
|
|
spaceId: "spaces/AAA",
|
|
typingMessageName: "spaces/AAA/messages/typing",
|
|
}),
|
|
).toBe(false);
|
|
});
|
|
|
|
it("does not durable-deliver non-final chunks", () => {
|
|
expect(
|
|
resolveGoogleChatDurableReplyOptions({
|
|
payload: { text: "hello" },
|
|
infoKind: "block",
|
|
spaceId: "spaces/AAA",
|
|
}),
|
|
).toBe(false);
|
|
});
|
|
});
|