mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:37:06 +02:00
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { createOpencodeCatalogApiKeyAuthMethod } from "./opencode.js";
|
|
|
|
describe("createOpencodeCatalogApiKeyAuthMethod", () => {
|
|
it("locks the shared OpenCode auth contract", () => {
|
|
const method = createOpencodeCatalogApiKeyAuthMethod({
|
|
providerId: "opencode-go",
|
|
label: "OpenCode Go catalog",
|
|
optionKey: "opencodeGoApiKey",
|
|
flagName: "--opencode-go-api-key",
|
|
defaultModel: "opencode-go/kimi-k2.5",
|
|
applyConfig: (cfg) => cfg,
|
|
noteMessage: "OpenCode uses one API key across the Zen and Go catalogs.",
|
|
choiceId: "opencode-go",
|
|
choiceLabel: "OpenCode Go catalog",
|
|
});
|
|
|
|
expect(method).toMatchObject({
|
|
id: "api-key",
|
|
label: "OpenCode Go catalog",
|
|
hint: "Shared API key for Zen + Go catalogs",
|
|
kind: "api_key",
|
|
wizard: {
|
|
choiceId: "opencode-go",
|
|
choiceLabel: "OpenCode Go catalog",
|
|
groupId: "opencode",
|
|
groupLabel: "OpenCode",
|
|
groupHint: "Shared API key for Zen + Go catalogs",
|
|
},
|
|
});
|
|
});
|
|
});
|