mirror of https://github.com/openclaw/openclaw.git
fix: honor slack default setup status
This commit is contained in:
parent
faff198777
commit
f59c52bc16
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue