diff --git a/src/channels/plugins/outbound/imessage.test.ts b/src/channels/plugins/outbound/imessage.test.ts deleted file mode 100644 index 04c68a94f82..00000000000 --- a/src/channels/plugins/outbound/imessage.test.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { describe, expect, it, vi } from "vitest"; -import { imessageOutbound } from "../../../../test/channel-outbounds.js"; -import type { OpenClawConfig } from "../../../config/config.js"; - -describe("imessageOutbound", () => { - const cfg: OpenClawConfig = { - channels: { - imessage: { - mediaMaxMb: 2, - }, - }, - }; - - it("passes replyToId through sendText", async () => { - const sendIMessage = vi.fn().mockResolvedValue({ messageId: "text-1" }); - const sendText = imessageOutbound.sendText; - expect(sendText).toBeDefined(); - - const result = await sendText!({ - cfg, - to: "chat_id:123", - text: "hello", - accountId: "default", - replyToId: "msg-123", - deps: { imessage: sendIMessage }, - }); - - expect(sendIMessage).toHaveBeenCalledWith( - "chat_id:123", - "hello", - expect.objectContaining({ - replyToId: "msg-123", - accountId: "default", - maxBytes: 2 * 1024 * 1024, - }), - ); - expect(result).toEqual({ channel: "imessage", messageId: "text-1" }); - }); - - it("passes replyToId through sendMedia", async () => { - const sendIMessage = vi.fn().mockResolvedValue({ messageId: "media-1" }); - const sendMedia = imessageOutbound.sendMedia; - expect(sendMedia).toBeDefined(); - - const result = await sendMedia!({ - cfg, - to: "chat_id:123", - text: "caption", - mediaUrl: "https://example.com/file.jpg", - mediaLocalRoots: ["/tmp"], - accountId: "acct-1", - replyToId: "msg-456", - deps: { imessage: sendIMessage }, - }); - - expect(sendIMessage).toHaveBeenCalledWith( - "chat_id:123", - "caption", - expect.objectContaining({ - mediaUrl: "https://example.com/file.jpg", - mediaLocalRoots: ["/tmp"], - replyToId: "msg-456", - accountId: "acct-1", - maxBytes: 2 * 1024 * 1024, - }), - ); - expect(result).toEqual({ channel: "imessage", messageId: "media-1" }); - }); -}); diff --git a/src/channels/plugins/outbound/signal.test.ts b/src/channels/plugins/outbound/signal.test.ts deleted file mode 100644 index 5d28e4aefaf..00000000000 --- a/src/channels/plugins/outbound/signal.test.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { describe, expect, it, vi } from "vitest"; -import { signalOutbound } from "../../../../test/channel-outbounds.js"; -import type { OpenClawConfig } from "../../../config/config.js"; - -describe("signalOutbound", () => { - const cfg: OpenClawConfig = { - channels: { - signal: { - mediaMaxMb: 8, - accounts: { - work: { - mediaMaxMb: 4, - }, - }, - }, - }, - }; - - it("passes account-scoped maxBytes for sendText", async () => { - const sendSignal = vi.fn().mockResolvedValue({ messageId: "sig-text-1", timestamp: 123 }); - const sendText = signalOutbound.sendText; - expect(sendText).toBeDefined(); - - const result = await sendText!({ - cfg, - to: "+15555550123", - text: "hello", - accountId: "work", - deps: { signal: sendSignal }, - }); - - expect(sendSignal).toHaveBeenCalledWith( - "+15555550123", - "hello", - expect.objectContaining({ - accountId: "work", - maxBytes: 4 * 1024 * 1024, - }), - ); - expect(result).toEqual({ channel: "signal", messageId: "sig-text-1", timestamp: 123 }); - }); - - it("passes mediaUrl/mediaLocalRoots for sendMedia", async () => { - const sendSignal = vi.fn().mockResolvedValue({ messageId: "sig-media-1", timestamp: 456 }); - const sendMedia = signalOutbound.sendMedia; - expect(sendMedia).toBeDefined(); - - const result = await sendMedia!({ - cfg, - to: "+15555550124", - text: "caption", - mediaUrl: "https://example.com/file.jpg", - mediaLocalRoots: ["/tmp/media"], - accountId: "default", - deps: { signal: sendSignal }, - }); - - expect(sendSignal).toHaveBeenCalledWith( - "+15555550124", - "caption", - expect.objectContaining({ - mediaUrl: "https://example.com/file.jpg", - mediaLocalRoots: ["/tmp/media"], - accountId: "default", - maxBytes: 8 * 1024 * 1024, - }), - ); - expect(result).toEqual({ channel: "signal", messageId: "sig-media-1", timestamp: 456 }); - }); -});