Files
openclaw/extensions/slack/src/interactive-replies.test.ts
scoootscooob 8746362f5e refactor(slack): move Slack channel code to extensions/slack/src/ (#45621)
Move all Slack channel implementation files from src/slack/ to
extensions/slack/src/ and replace originals with shim re-exports.
This follows the extension migration pattern for channel plugins.

- Copy all .ts files to extensions/slack/src/ (preserving directory
  structure: monitor/, http/, monitor/events/, monitor/message-handler/)
- Transform import paths: external src/ imports use relative paths
  back to src/, internal slack imports stay relative within extension
- Replace all src/slack/ files with shim re-exports pointing to
  the extension copies
- Update tsconfig.plugin-sdk.dts.json rootDir from "src" to "." so
  the DTS build can follow shim chains into extensions/
- Update write-plugin-sdk-entry-dts.ts re-export path accordingly
- Preserve extensions/slack/index.ts, package.json, openclaw.plugin.json,
  src/channel.ts, src/runtime.ts, src/channel.test.ts (untouched)
2026-03-14 02:47:04 -07:00

39 lines
1.0 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("fails closed when accountId is unknown and multiple accounts exist", () => {
const cfg = {
channels: {
slack: {
accounts: {
one: {
capabilities: { interactiveReplies: true },
},
two: {},
},
},
},
} as OpenClawConfig;
expect(isSlackInteractiveRepliesEnabled({ cfg, accountId: undefined })).toBe(false);
});
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);
});
});