























@@ -89,6 +89,28 @@ describe("createChannelOutboundRuntimeSend", () => {
8989expect(params.accountId).toBe("default");
9090});
919192+it("preserves rendered html formatting through lazy text sends", async () => {
93+const sendText = vi.fn(async () => ({ channel: "telegram", messageId: "tg-1" }));
94+mocks.loadChannelOutboundAdapter.mockResolvedValue({
95+ sendText,
96+});
97+98+const { createChannelOutboundRuntimeSend } = await import("./channel-outbound-send.js");
99+const runtimeSend = createChannelOutboundRuntimeSend({
100+channelId: "telegram" as never,
101+unavailableMessage: "unavailable",
102+});
103+const opts = {
104+cfg: {},
105+textMode: "html" as const,
106+};
107+108+await runtimeSend.sendMessage("12345", '<a href="https://example.com">Example</a>', opts);
109+110+const params = expectSingleCallParams(sendText);
111+expect(params.formatting).toEqual({ parseMode: "HTML" });
112+});
113+92114it("routes block sends through payload delivery", async () => {
93115const sendPayload = vi.fn(async () => ({ channel: "slack", messageId: "slack-blocks" }));
94116const sendText = vi.fn();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。