diff --git a/src/channels/plugins/registry.test.ts b/src/channels/plugins/registry.test.ts index e7d46ebe599..105573f4fea 100644 --- a/src/channels/plugins/registry.test.ts +++ b/src/channels/plugins/registry.test.ts @@ -1,9 +1,19 @@ -import { afterEach, describe, expect, it } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; import { createEmptyPluginRegistry } from "../../plugins/registry-empty.js"; import type { PluginRegistry } from "../../plugins/registry.js"; import { resetPluginRuntimeStateForTest, setActivePluginRegistry } from "../../plugins/runtime.js"; import { getChannelPlugin, listChannelPlugins } from "./registry.js"; +vi.mock("./bundled.js", () => ({ + getBundledChannelPlugin: (id: string) => + id === "fallback" + ? { + id: "fallback", + meta: { label: "fallback" }, + } + : undefined, +})); + function withMalformedChannels(registry: PluginRegistry): PluginRegistry { const malformed = { ...registry } as PluginRegistry; (malformed as { channels?: unknown }).channels = undefined; @@ -25,11 +35,7 @@ describe("listChannelPlugins", () => { it("falls back to bundled channel plugins for direct lookups before registry bootstrap", () => { setActivePluginRegistry(createEmptyPluginRegistry()); - expect(getChannelPlugin("googlechat")?.doctor).toMatchObject({ - dmAllowFromMode: "nestedOnly", - groupAllowFromFallbackToAllowFrom: false, - warnOnEmptyGroupSenderAllowlist: false, - }); + expect(getChannelPlugin("fallback")?.meta.label).toBe("fallback"); }); it("rebuilds channel lookups when the active registry object changes without a version bump", () => {