mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:50:43 +00:00
test: narrow agents bind and provider auth cases
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createBindingResolverTestPlugin } from "../test-utils/channel-plugins.js";
|
||||
import {
|
||||
loadFreshAgentsCommandModuleForTest,
|
||||
loadFreshAgentsBindCommandModuleForTest,
|
||||
readConfigFileSnapshotMock,
|
||||
resetAgentsBindTestHarness,
|
||||
runtime,
|
||||
@@ -51,14 +51,14 @@ vi.mock("../channels/plugins/index.js", async () => {
|
||||
};
|
||||
});
|
||||
|
||||
let agentsBindCommand: typeof import("./agents.js").agentsBindCommand;
|
||||
let agentsBindingsCommand: typeof import("./agents.js").agentsBindingsCommand;
|
||||
let agentsUnbindCommand: typeof import("./agents.js").agentsUnbindCommand;
|
||||
let agentsBindCommand: typeof import("./agents.commands.bind.js").agentsBindCommand;
|
||||
let agentsBindingsCommand: typeof import("./agents.commands.bind.js").agentsBindingsCommand;
|
||||
let agentsUnbindCommand: typeof import("./agents.commands.bind.js").agentsUnbindCommand;
|
||||
|
||||
describe("agents bind/unbind commands", () => {
|
||||
beforeEach(async () => {
|
||||
({ agentsBindCommand, agentsBindingsCommand, agentsUnbindCommand } =
|
||||
await loadFreshAgentsCommandModuleForTest());
|
||||
await loadFreshAgentsBindCommandModuleForTest());
|
||||
resetAgentsBindTestHarness();
|
||||
});
|
||||
|
||||
|
||||
@@ -1329,24 +1329,6 @@ describe("onboard (non-interactive): provider auth", () => {
|
||||
key: "xai-test-key",
|
||||
expectedModel: "xai/grok-4",
|
||||
},
|
||||
{
|
||||
options: {
|
||||
mistralApiKey: "mistral-test-key", // pragma: allowlist secret
|
||||
},
|
||||
profileId: "mistral:default",
|
||||
provider: "mistral",
|
||||
key: "mistral-test-key",
|
||||
},
|
||||
{
|
||||
options: {
|
||||
authChoice: "ai-gateway-api-key",
|
||||
aiGatewayApiKey: "gateway-test-key", // pragma: allowlist secret
|
||||
},
|
||||
profileId: "vercel-ai-gateway:default",
|
||||
provider: "vercel-ai-gateway",
|
||||
key: "gateway-test-key",
|
||||
expectedModel: "vercel-ai-gateway/anthropic/claude-opus-4.6",
|
||||
},
|
||||
{
|
||||
options: {
|
||||
modelstudioApiKey: "modelstudio-test-key", // pragma: allowlist secret
|
||||
@@ -1413,13 +1395,6 @@ describe("onboard (non-interactive): provider auth", () => {
|
||||
|
||||
it("fails fast when ref mode receives explicit provider keys without env and does not leak keys", async () => {
|
||||
const scenarios = [
|
||||
{
|
||||
name: "anthropic",
|
||||
authChoice: "apiKey",
|
||||
optionKey: "anthropicApiKey",
|
||||
flagName: "--anthropic-api-key",
|
||||
envVar: "ANTHROPIC_API_KEY",
|
||||
},
|
||||
{
|
||||
name: "openai",
|
||||
authChoice: "openai-api-key",
|
||||
@@ -1427,13 +1402,6 @@ describe("onboard (non-interactive): provider auth", () => {
|
||||
flagName: "--openai-api-key",
|
||||
envVar: "OPENAI_API_KEY",
|
||||
},
|
||||
{
|
||||
name: "openrouter",
|
||||
authChoice: "openrouter-api-key",
|
||||
optionKey: "openrouterApiKey",
|
||||
flagName: "--openrouter-api-key",
|
||||
envVar: "OPENROUTER_API_KEY",
|
||||
},
|
||||
] as const;
|
||||
|
||||
await withOnboardEnv("openclaw-onboard-ref-flag-", async () => {
|
||||
|
||||
Reference in New Issue
Block a user