Files
Moltbot/src/agents/pi-embedded-subscribe.tools.test.ts
Peter Lee 851fcb2617 feat: Add --localTime option to logs command for local timezone display (#13818)
* feat: add --localTime options to make logs to show time with local time zone

fix #12447

* fix: prep logs local-time option and docs (#13818) (thanks @xialonglee)

---------

Co-authored-by: xialonglee <li.xialong@xydigit.com>
Co-authored-by: Sebastian <19554889+sebslight@users.noreply.github.com>
2026-02-11 08:24:08 -05:00

39 lines
1.2 KiB
TypeScript

import { beforeEach, describe, expect, it } from "vitest";
import { telegramPlugin } from "../../extensions/telegram/src/channel.js";
import { setActivePluginRegistry } from "../plugins/runtime.js";
import { createTestRegistry } from "../test-utils/channel-plugins.js";
import { extractMessagingToolSend } from "./pi-embedded-subscribe.tools.js";
describe("extractMessagingToolSend", () => {
beforeEach(() => {
setActivePluginRegistry(
createTestRegistry([{ pluginId: "telegram", plugin: telegramPlugin, source: "test" }]),
);
});
it("uses channel as provider for message tool", () => {
const result = extractMessagingToolSend("message", {
action: "send",
channel: "telegram",
to: "123",
});
expect(result?.tool).toBe("message");
expect(result?.provider).toBe("telegram");
expect(result?.to).toBe("telegram:123");
});
it("prefers provider when both provider and channel are set", () => {
const result = extractMessagingToolSend("message", {
action: "send",
provider: "slack",
channel: "telegram",
to: "channel:C1",
});
expect(result?.tool).toBe("message");
expect(result?.provider).toBe("slack");
expect(result?.to).toBe("channel:C1");
});
});