mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-07 22:44:16 +00:00
test(slack): pass cfg to buildAccountSnapshot in tests
This commit is contained in:
@@ -107,7 +107,7 @@ describe("slackPlugin outbound", () => {
|
||||
});
|
||||
|
||||
describe("slackPlugin config", () => {
|
||||
it("treats HTTP mode accounts with bot token + signing secret as configured", () => {
|
||||
it("treats HTTP mode accounts with bot token + signing secret as configured", async () => {
|
||||
const cfg: OpenClawConfig = {
|
||||
channels: {
|
||||
slack: {
|
||||
@@ -120,13 +120,17 @@ describe("slackPlugin config", () => {
|
||||
|
||||
const account = slackPlugin.config.resolveAccount(cfg, "default");
|
||||
const configured = slackPlugin.config.isConfigured?.(account, cfg);
|
||||
const snapshot = slackPlugin.status?.buildAccountSnapshot?.({ account, runtime: undefined });
|
||||
const snapshot = await slackPlugin.status?.buildAccountSnapshot?.({
|
||||
account,
|
||||
cfg,
|
||||
runtime: undefined,
|
||||
});
|
||||
|
||||
expect(configured).toBe(true);
|
||||
expect(snapshot?.configured).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps socket mode requiring app token", () => {
|
||||
it("keeps socket mode requiring app token", async () => {
|
||||
const cfg: OpenClawConfig = {
|
||||
channels: {
|
||||
slack: {
|
||||
@@ -138,7 +142,11 @@ describe("slackPlugin config", () => {
|
||||
|
||||
const account = slackPlugin.config.resolveAccount(cfg, "default");
|
||||
const configured = slackPlugin.config.isConfigured?.(account, cfg);
|
||||
const snapshot = slackPlugin.status?.buildAccountSnapshot?.({ account, runtime: undefined });
|
||||
const snapshot = await slackPlugin.status?.buildAccountSnapshot?.({
|
||||
account,
|
||||
cfg,
|
||||
runtime: undefined,
|
||||
});
|
||||
|
||||
expect(configured).toBe(false);
|
||||
expect(snapshot?.configured).toBe(false);
|
||||
|
||||
Reference in New Issue
Block a user