fix: honor irc default setup status

This commit is contained in:
Tak Hoffman
2026-04-03 15:47:49 -05:00
parent cfef9bf856
commit 2e9cad224d
2 changed files with 27 additions and 6 deletions

View File

@@ -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",

View File

@@ -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: {} } };