fix: add adapter coverage for emoji-list limit forwarding (openclaw#13421) thanks @mcaxtr

This commit is contained in:
Peter Steinberger
2026-02-13 18:10:27 +01:00
parent a8f0b77bb2
commit 713b3a29bf

View File

@@ -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,
});
});
});