fix: honor slack default setup status

This commit is contained in:
Tak Hoffman 2026-04-03 15:20:58 -05:00
parent faff198777
commit f59c52bc16
No known key found for this signature in database
2 changed files with 29 additions and 4 deletions

View File

@ -167,10 +167,7 @@ export function createSlackSetupWizardBase(handlers: {
configuredScore: 2,
unconfiguredScore: 1,
resolveConfigured: ({ cfg, accountId }) =>
(accountId ? [accountId] : listSlackAccountIds(cfg)).some((resolvedAccountId) => {
const account = inspectSlackAccount({ cfg, accountId: resolvedAccountId });
return account.configured;
}),
inspectSlackAccount({ cfg, accountId }).configured,
}),
introNote: {
title: "Slack socket mode tokens",

View File

@ -118,3 +118,31 @@ describe("slackSetupWizard.dmPolicy", () => {
expect(next?.channels?.slack?.accounts?.alerts?.allowFrom).toEqual(["U123", "*"]);
});
});
describe("slackSetupWizard.status", () => {
it("uses configured defaultAccount for omitted setup configured state", async () => {
const configured = await slackSetupWizard.status.resolveConfigured({
cfg: {
channels: {
slack: {
defaultAccount: "work",
botToken: "xoxb-root",
appToken: "xapp-root",
accounts: {
alerts: {
botToken: "xoxb-alerts",
appToken: "xapp-alerts",
},
work: {
botToken: "",
appToken: "",
},
},
},
},
} as OpenClawConfig,
});
expect(configured).toBe(false);
});
});