2026-07-13 13:11:46 +08:00
|
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
|
|
2026-07-19 23:30:49 +08:00
|
|
|
import { channelUiPresentation } from "@/channel-plugins/registry";
|
|
|
|
|
|
|
|
|
|
const SLACK_SOCKET_MODE_MANIFEST = channelUiPresentation("slack")?.setup?.actions?.find(
|
|
|
|
|
(action) => action.id === "slack-manifest",
|
|
|
|
|
)?.copyText;
|
2026-07-13 13:11:46 +08:00
|
|
|
|
|
|
|
|
describe("Slack setup manifest", () => {
|
|
|
|
|
it.each(["app_mention", "message.channels", "message.groups", "message.im", "message.mpim"])(
|
|
|
|
|
"subscribes to %s",
|
|
|
|
|
(event) => expect(SLACK_SOCKET_MODE_MANIFEST).toContain(` - ${event}`),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
it.each([
|
|
|
|
|
"app_mentions:read",
|
|
|
|
|
"channels:history",
|
|
|
|
|
"channels:read",
|
|
|
|
|
"chat:write",
|
|
|
|
|
"files:read",
|
|
|
|
|
"files:write",
|
|
|
|
|
"groups:history",
|
|
|
|
|
"groups:read",
|
|
|
|
|
"im:history",
|
|
|
|
|
"im:write",
|
|
|
|
|
"mpim:history",
|
|
|
|
|
"reactions:write",
|
|
|
|
|
"users:read",
|
|
|
|
|
])("requests the %s scope", (scope) => {
|
|
|
|
|
expect(SLACK_SOCKET_MODE_MANIFEST).toContain(` - ${scope}`);
|
|
|
|
|
});
|
|
|
|
|
});
|