mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-22 22:52:03 +00:00
* Reply: add Slack interactive directive parser * Reply: wire Slack directives into normalization * Reply: cover Slack directive parsing * Reply: test Slack directive normalization * Slack: hint interactive reply directives * Config: add Slack interactive reply capability type * Config: validate Slack interactive reply capability * Reply: gate Slack directives behind capability * Slack: gate interactive reply hints by capability * Tests: cover Slack interactive reply capability gating * Changelog: note opt-in Slack interactive replies * Slack: fix interactive reply review findings * Slack: harden interactive reply routing and limits * Slack: harden interactive reply trust and validation
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { OpenClawConfig } from "../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);
|
|
});
|
|
});
|