mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-21 21:55:07 +00:00
fix: honor irc default setup status
This commit is contained in:
@@ -179,12 +179,7 @@ export const ircSetupWizard: ChannelSetupWizard = {
|
||||
unconfiguredScore: 0,
|
||||
includeStatusLine: true,
|
||||
resolveConfigured: ({ cfg, accountId }) =>
|
||||
accountId
|
||||
? resolveIrcAccount({ cfg: cfg as CoreConfig, accountId }).configured
|
||||
: listIrcAccountIds(cfg as CoreConfig).some(
|
||||
(resolvedAccountId) =>
|
||||
resolveIrcAccount({ cfg: cfg as CoreConfig, accountId: resolvedAccountId }).configured,
|
||||
),
|
||||
resolveIrcAccount({ cfg: cfg as CoreConfig, accountId }).configured,
|
||||
}),
|
||||
introNote: {
|
||||
title: "IRC setup",
|
||||
|
||||
@@ -138,6 +138,32 @@ describe("irc setup", () => {
|
||||
expect(status.statusLines).toEqual(["IRC: needs host + nick"]);
|
||||
});
|
||||
|
||||
it("setup status honors the configured default account", async () => {
|
||||
const status = await ircStatus({
|
||||
cfg: {
|
||||
channels: {
|
||||
irc: {
|
||||
defaultAccount: "work",
|
||||
accounts: {
|
||||
ops: {
|
||||
host: "irc.example.com",
|
||||
nick: "ops-bot",
|
||||
},
|
||||
work: {
|
||||
host: "irc.example.com",
|
||||
nick: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as CoreConfig,
|
||||
accountOverrides: {},
|
||||
});
|
||||
|
||||
expect(status.configured).toBe(false);
|
||||
expect(status.statusLines).toEqual(["IRC: needs host + nick"]);
|
||||
});
|
||||
|
||||
it("stores nickserv and account config patches on the scoped account", () => {
|
||||
const cfg: CoreConfig = { channels: { irc: {} } };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user