Files
openclaw/src/infra/provider-usage.auth.plugin.test.ts
Vincent Koc 466510b6d8 refactor: replace "seam" terminology across codebase
Replace "seam" with clearer terms throughout:
- "surface" for public API/extension boundaries
- "boundary" for plugin/module interfaces
- "interface" for runtime connection points
- "hook" for test injection points
- "palette" for the lobster palette reference

Also delete experiments/acp-pluginification-architecture-plan.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 00:20:15 -07:00

37 lines
1.1 KiB
TypeScript

import { beforeEach, describe, expect, it, vi } from "vitest";
const resolveProviderUsageAuthWithPluginMock = vi.fn();
vi.mock("../plugins/provider-runtime.js", () => ({
resolveProviderUsageAuthWithPlugin: (...args: unknown[]) =>
resolveProviderUsageAuthWithPluginMock(...args),
}));
let resolveProviderAuths: typeof import("./provider-usage.auth.js").resolveProviderAuths;
describe("resolveProviderAuths plugin boundary", () => {
beforeEach(async () => {
vi.resetModules();
resolveProviderUsageAuthWithPluginMock.mockReset();
resolveProviderUsageAuthWithPluginMock.mockResolvedValue(null);
({ resolveProviderAuths } = await import("./provider-usage.auth.js"));
});
it("prefers plugin-owned usage auth when available", async () => {
resolveProviderUsageAuthWithPluginMock.mockResolvedValueOnce({
token: "plugin-zai-token",
});
await expect(
resolveProviderAuths({
providers: ["zai"],
}),
).resolves.toEqual([
{
provider: "zai",
token: "plugin-zai-token",
},
]);
});
});