diff --git a/src/commands/channels.add.test.ts b/src/commands/channels.add.test.ts index d6d139e968d..e35bcd189c7 100644 --- a/src/commands/channels.add.test.ts +++ b/src/commands/channels.add.test.ts @@ -2,6 +2,7 @@ import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import type { ChannelPluginCatalogEntry } from "../channels/plugins/catalog.js"; import type { ChannelPlugin } from "../channels/plugins/types.js"; import { setActivePluginRegistry } from "../plugins/runtime.js"; +import { DEFAULT_ACCOUNT_ID } from "../routing/session-key.js"; import { createChannelTestPluginBase, createTestRegistry } from "../test-utils/channel-plugins.js"; import { ensureChannelSetupPluginInstalled, @@ -13,7 +14,6 @@ import { createMSTeamsSetupPlugin, } from "./channels.plugin-install.test-helpers.js"; import { baseConfigSnapshot, createTestRuntime } from "./test-runtime-config-helpers.js"; -import { DEFAULT_ACCOUNT_ID } from "../routing/session-key.js"; const catalogMocks = vi.hoisted(() => ({ listChannelPluginCatalogEntries: vi.fn((): ChannelPluginCatalogEntry[] => []), @@ -96,7 +96,9 @@ function createTelegramAddTestPlugin(): ChannelPlugin { config: { listAccountIds: (cfg) => listConfiguredAccountIds( - cfg.channels?.telegram as { accounts?: Record; botToken?: string } | undefined, + cfg.channels?.telegram as + | { accounts?: Record; botToken?: string } + | undefined, ), resolveAccount: resolveTelegramAccount, }, @@ -132,9 +134,9 @@ function createTelegramAddTestPlugin(): ChannelPlugin { ...telegram, enabled: true, accounts: { - ...(telegram.accounts ?? {}), + ...telegram.accounts, [resolvedAccountId]: { - ...(telegram.accounts?.[resolvedAccountId] ?? {}), + ...telegram.accounts?.[resolvedAccountId], ...(input.token ? { botToken: input.token } : {}), }, },