Files
openclaw/extensions/slack/src/interactive-replies.test.ts
Vincent Koc f2475a7f70 fix(slack): improve interactive reply parity (#53389)
* fix(slack): improve interactive reply parity

* fix(slack): isolate reply interactions from plugins

* docs(changelog): note slack interactive parity fixes

* fix(slack): preserve preview text for local agent replies

* fix(agent): preserve directive text in local previews
2026-03-24 10:23:10 -07:00

40 lines
1.1 KiB
TypeScript

import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../../src/config/config.js";
import { isSlackInteractiveRepliesEnabled } from "./interactive-replies.js";
describe("isSlackInteractiveRepliesEnabled", () => {
it("uses the configured default account when accountId is unknown and multiple accounts exist", () => {
const cfg = {
channels: {
slack: {
defaultAccount: "one",
accounts: {
one: {
capabilities: { interactiveReplies: true },
},
two: {},
},
},
},
} as OpenClawConfig;
expect(isSlackInteractiveRepliesEnabled({ cfg, accountId: undefined })).toBe(true);
});
it("uses the only configured account when accountId is unknown", () => {
const cfg = {
channels: {
slack: {
accounts: {
only: {
capabilities: { interactiveReplies: true },
},
},
},
},
} as OpenClawConfig;
expect(isSlackInteractiveRepliesEnabled({ cfg, accountId: undefined })).toBe(true);
});
});