mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-29 16:13:33 +00:00
18 lines
784 B
TypeScript
18 lines
784 B
TypeScript
import { chunkMarkdownText } from "openclaw/plugin-sdk/reply-runtime";
|
|
import { describe, expect, it } from "vitest";
|
|
import { telegramOutboundBaseAdapter } from "./outbound-base.js";
|
|
import { clearTelegramRuntime } from "./runtime.js";
|
|
|
|
describe("telegramPlugin outbound", () => {
|
|
it("uses static chunking when Telegram runtime is uninitialized", () => {
|
|
clearTelegramRuntime();
|
|
const text = `${"hello\n".repeat(1200)}tail`;
|
|
const expected = chunkMarkdownText(text, 4000);
|
|
|
|
expect(telegramOutboundBaseAdapter.chunker(text, 4000)).toEqual(expected);
|
|
expect(telegramOutboundBaseAdapter.deliveryMode).toBe("direct");
|
|
expect(telegramOutboundBaseAdapter.chunkerMode).toBe("markdown");
|
|
expect(telegramOutboundBaseAdapter.textChunkLimit).toBe(4000);
|
|
});
|
|
});
|