diff --git a/src/channels/plugins/slack.actions.test.ts b/src/channels/plugins/slack.actions.test.ts index a6644e3965d..844da4f09ad 100644 --- a/src/channels/plugins/slack.actions.test.ts +++ b/src/channels/plugins/slack.actions.test.ts @@ -1,4 +1,4 @@ -import { describe, expect, it, vi } from "vitest"; +import { beforeEach, describe, expect, it, vi } from "vitest"; import type { OpenClawConfig } from "../../config/config.js"; import { createSlackActions } from "./slack.actions.js"; @@ -9,6 +9,10 @@ vi.mock("../../agents/tools/slack-actions.js", () => ({ })); describe("slack actions adapter", () => { + beforeEach(() => { + handleSlackAction.mockClear(); + }); + it("forwards threadId for read", async () => { const cfg = { channels: { slack: { botToken: "tok" } } } as OpenClawConfig; const actions = createSlackActions("slack"); @@ -30,4 +34,24 @@ describe("slack actions adapter", () => { threadId: "171234.567", }); }); + + it("forwards normalized limit for emoji-list", async () => { + const cfg = { channels: { slack: { botToken: "tok" } } } as OpenClawConfig; + const actions = createSlackActions("slack"); + + await actions.handleAction?.({ + channel: "slack", + action: "emoji-list", + cfg, + params: { + limit: "2.9", + }, + }); + + const [params] = handleSlackAction.mock.calls[0] ?? []; + expect(params).toMatchObject({ + action: "emojiList", + limit: 2, + }); + }); });