mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 17:44:33 +00:00
fix: land telegram empty-html fallback hardening (#25096) (thanks @Glucksberg)
This commit is contained in:
@@ -245,7 +245,7 @@ describe("deliverReplies", () => {
|
||||
});
|
||||
|
||||
it("falls back to plain text when markdown renders to empty HTML in threaded mode", async () => {
|
||||
const runtime = { error: vi.fn(), log: vi.fn() };
|
||||
const runtime = createRuntime();
|
||||
const sendMessage = vi.fn(async (_chatId: string, text: string) => {
|
||||
if (text === "") {
|
||||
throw new Error("400: Bad Request: message text is empty");
|
||||
@@ -279,7 +279,7 @@ describe("deliverReplies", () => {
|
||||
});
|
||||
|
||||
it("throws when formatted and plain fallback text are both empty", async () => {
|
||||
const runtime = { error: vi.fn(), log: vi.fn() };
|
||||
const runtime = createRuntime();
|
||||
const sendMessage = vi.fn();
|
||||
const bot = { api: { sendMessage } } as unknown as Bot;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user