From 969ca8511d6fa4d853f1eac74728d0841e07757f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 21 Apr 2026 01:42:29 +0100 Subject: [PATCH] test: use synthetic cli provider fixtures --- src/cli/channel-options.test.ts | 12 ++++++------ src/cli/plugin-registry-loader.test.ts | 4 ++-- src/cli/run-main.test.ts | 4 ++-- src/commands/agents.providers.test.ts | 20 ++++++++++---------- src/commands/status.command-report.test.ts | 4 ++-- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/cli/channel-options.test.ts b/src/cli/channel-options.test.ts index 604faf640d0..6e538402d31 100644 --- a/src/cli/channel-options.test.ts +++ b/src/cli/channel-options.test.ts @@ -17,7 +17,7 @@ vi.mock("node:fs", async () => { }); vi.mock("../channels/ids.js", () => ({ - CHAT_CHANNEL_ORDER: ["telegram", "discord"], + CHAT_CHANNEL_ORDER: ["quietchat", "forum"], })); describe("resolveCliChannelOptions", () => { @@ -28,10 +28,10 @@ describe("resolveCliChannelOptions", () => { it("uses precomputed startup metadata when available", async () => { readFileSyncMock.mockReturnValue( - JSON.stringify({ channelOptions: ["cached", "telegram", "cached"] }), + JSON.stringify({ channelOptions: ["cached", "quietchat", "cached"] }), ); - expect(resolveCliChannelOptions()).toEqual(["cached", "telegram"]); + expect(resolveCliChannelOptions()).toEqual(["cached", "quietchat"]); }); it("falls back to core channel order when metadata is missing", async () => { @@ -39,14 +39,14 @@ describe("resolveCliChannelOptions", () => { throw new Error("ENOENT"); }); - expect(resolveCliChannelOptions()).toEqual(["telegram", "discord"]); + expect(resolveCliChannelOptions()).toEqual(["quietchat", "forum"]); }); it("ignores external catalog env during CLI bootstrap", async () => { process.env.OPENCLAW_PLUGIN_CATALOG_PATHS = "/tmp/plugins-catalog.json"; - readFileSyncMock.mockReturnValue(JSON.stringify({ channelOptions: ["cached", "telegram"] })); + readFileSyncMock.mockReturnValue(JSON.stringify({ channelOptions: ["cached", "quietchat"] })); - expect(resolveCliChannelOptions()).toEqual(["cached", "telegram"]); + expect(resolveCliChannelOptions()).toEqual(["cached", "quietchat"]); delete process.env.OPENCLAW_PLUGIN_CATALOG_PATHS; }); }); diff --git a/src/cli/plugin-registry-loader.test.ts b/src/cli/plugin-registry-loader.test.ts index c11d1f611b4..f377f9ab4f8 100644 --- a/src/cli/plugin-registry-loader.test.ts +++ b/src/cli/plugin-registry-loader.test.ts @@ -61,8 +61,8 @@ describe("plugin-registry-loader", () => { }); it("forwards explicit config snapshots to plugin loading", async () => { - const config = { channels: { telegram: { enabled: true } } } as never; - const activationSourceConfig = { channels: { telegram: { enabled: true } } } as never; + const config = { channels: { quietchat: { enabled: true } } } as never; + const activationSourceConfig = { channels: { quietchat: { enabled: true } } } as never; await ensureCliPluginRegistryLoaded({ scope: "configured-channels", diff --git a/src/cli/run-main.test.ts b/src/cli/run-main.test.ts index 8b01e9de2d2..b528fef8aa8 100644 --- a/src/cli/run-main.test.ts +++ b/src/cli/run-main.test.ts @@ -96,7 +96,7 @@ describe("resolveMissingPluginCommandMessage", () => { expect( resolveMissingPluginCommandMessage("browser", { plugins: { - allow: ["telegram"], + allow: ["quietchat"], }, }), ).toContain('`plugins.allow` excludes "browser"'); @@ -187,7 +187,7 @@ describe("resolveMissingPluginCommandMessage", () => { "wiki", { plugins: { - allow: ["telegram"], + allow: ["quietchat"], }, }, { registry: memoryWikiCommandAliasRegistry }, diff --git a/src/commands/agents.providers.test.ts b/src/commands/agents.providers.test.ts index dfebd607539..1e170d703de 100644 --- a/src/commands/agents.providers.test.ts +++ b/src/commands/agents.providers.test.ts @@ -44,8 +44,8 @@ describe("buildProviderStatusIndex", () => { throw new Error("should not be used when inspectAccount exists"); }); const plugin = { - id: "slack", - meta: { label: "Slack" }, + id: "workchat", + meta: { label: "WorkChat" }, config: { listAccountIds: () => ["work"], inspectAccount, @@ -62,8 +62,8 @@ describe("buildProviderStatusIndex", () => { expect(resolveAccount).not.toHaveBeenCalled(); expect(inspectAccount).toHaveBeenCalledWith({}, "work"); - expect(map.get("slack:work")).toMatchObject({ - provider: "slack", + expect(map.get("workchat:work")).toMatchObject({ + provider: "workchat", accountId: "work", state: "linked", configured: true, @@ -74,8 +74,8 @@ describe("buildProviderStatusIndex", () => { it("records accounts that throw during read-only resolution as not configured", async () => { const plugin = { - id: "telegram", - meta: { label: "Telegram" }, + id: "quietchat", + meta: { label: "QuietChat" }, config: { listAccountIds: () => ["default"], resolveAccount: () => { @@ -91,9 +91,9 @@ describe("buildProviderStatusIndex", () => { await expect(buildProviderStatusIndex({} as OpenClawConfig)).resolves.toEqual( new Map([ [ - "telegram:default", + "quietchat:default", { - provider: "telegram", + provider: "quietchat", accountId: "default", state: "not configured", configured: false, @@ -105,8 +105,8 @@ describe("buildProviderStatusIndex", () => { it("rethrows unexpected read-only account resolution errors", async () => { const plugin = { - id: "telegram", - meta: { label: "Telegram" }, + id: "quietchat", + meta: { label: "QuietChat" }, config: { listAccountIds: () => ["default"], resolveAccount: () => { diff --git a/src/commands/status.command-report.test.ts b/src/commands/status.command-report.test.ts index a3d10c549d4..026c589c929 100644 --- a/src/commands/status.command-report.test.ts +++ b/src/commands/status.command-report.test.ts @@ -20,7 +20,7 @@ describe("buildStatusCommandReportLines", () => { pairingRecoveryLines: ["pairing needed"], securityAuditLines: ["audit line"], channelsColumns: [{ key: "Channel", header: "Channel" }], - channelsRows: [{ Channel: "telegram" }], + channelsRows: [{ Channel: "quietchat" }], sessionsColumns: [{ key: "Key", header: "Key" }], sessionsRows: [{ Key: "main" }], systemEventsRows: [{ Event: "queued" }], @@ -81,7 +81,7 @@ describe("buildStatusCommandReportLines", () => { pairingRecoveryLines: [], securityAuditLines: ["audit line"], channelsColumns: [{ key: "Channel", header: "Channel" }], - channelsRows: [{ Channel: "telegram" }], + channelsRows: [{ Channel: "quietchat" }], sessionsColumns: [{ key: "Key", header: "Key" }], sessionsRows: [{ Key: "main" }], footerLines: ["FAQ"],