Download src/slack/interactive-replies.test.ts from Darochin/openskynet: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/Darochin/openskynet/resolve/main/src/slack/interactive-replies.test.ts
- Command line
-
hf download hf://Darochin/openskynet/src/slack/interactive-replies.test.ts
-
curl -L -o interactive-replies.test.ts https://huggingface.co/Darochin/openskynet/resolve/main/src/slack/interactive-replies.test.ts
1.06 kB
| 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); | |
| }); | |
| }); | |