From 2cfe8e17f5ec618afda538f588139410db3652c8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 28 Apr 2026 08:21:35 +0100 Subject: [PATCH] test: type channel list plugin stubs --- .../channels.list.auth-profiles.test.ts | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/commands/channels.list.auth-profiles.test.ts b/src/commands/channels.list.auth-profiles.test.ts index bdf0e8fd38d..6fe62d8a747 100644 --- a/src/commands/channels.list.auth-profiles.test.ts +++ b/src/commands/channels.list.auth-profiles.test.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; +import type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; import { baseConfigSnapshot, createTestRuntime } from "./test-runtime-config-helpers.js"; const mocks = vi.hoisted(() => ({ @@ -9,7 +10,7 @@ const mocks = vi.hoisted(() => ({ diagnostics: [], })), loadAuthProfileStoreWithoutExternalProfiles: vi.fn(), - listReadOnlyChannelPluginsForConfig: vi.fn(() => []), + listReadOnlyChannelPluginsForConfig: vi.fn<() => ChannelPlugin[]>(() => []), buildChannelAccountSnapshot: vi.fn(), })); @@ -93,9 +94,17 @@ describe("channels list auth profiles", () => { mocks.listReadOnlyChannelPluginsForConfig.mockReturnValue([ { id: "telegram", - meta: { id: "telegram", label: "Telegram" }, + meta: { + id: "telegram", + label: "Telegram", + selectionLabel: "Telegram", + docsPath: "/channels/telegram", + blurb: "Telegram", + }, + capabilities: { chatTypes: ["direct"] }, config: { listAccountIds: () => ["alerts", "default"], + resolveAccount: () => ({}), }, }, ]); @@ -134,9 +143,17 @@ describe("channels list auth profiles", () => { mocks.listReadOnlyChannelPluginsForConfig.mockReturnValue([ { id: "telegram", - meta: { id: "telegram", label: "Telegram" }, + meta: { + id: "telegram", + label: "Telegram", + selectionLabel: "Telegram", + docsPath: "/channels/telegram", + blurb: "Telegram", + }, + capabilities: { chatTypes: ["direct"] }, config: { listAccountIds: () => ["default"], + resolveAccount: () => ({}), }, }, ]);