From 366ef93641ad5f0f3b3c389a4f53dbdda6a2e4e1 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Wed, 17 Jun 2026 17:56:13 +0800 Subject: [PATCH] test(agents): inline auth profile ordering fixtures --- ...tize-lastgood-round-robin-ordering.test.ts | 30 ++++++++++++++--- ...les.resolve-auth-profile-order.fixtures.ts | 32 ------------------- 2 files changed, 26 insertions(+), 36 deletions(-) delete mode 100644 src/agents/auth-profiles.resolve-auth-profile-order.fixtures.ts diff --git a/src/agents/auth-profiles.resolve-auth-profile-order.does-not-prioritize-lastgood-round-robin-ordering.test.ts b/src/agents/auth-profiles.resolve-auth-profile-order.does-not-prioritize-lastgood-round-robin-ordering.test.ts index 446235b20d21..f2dfb5e7022d 100644 --- a/src/agents/auth-profiles.resolve-auth-profile-order.does-not-prioritize-lastgood-round-robin-ordering.test.ts +++ b/src/agents/auth-profiles.resolve-auth-profile-order.does-not-prioritize-lastgood-round-robin-ordering.test.ts @@ -4,10 +4,7 @@ * round-robin ordering semantics. */ import { describe, expect, it, vi } from "vitest"; -import { - ANTHROPIC_CFG, - ANTHROPIC_STORE, -} from "./auth-profiles.resolve-auth-profile-order.fixtures.js"; +import type { OpenClawConfig } from "../config/types.openclaw.js"; import { resolveAuthProfileOrder } from "./auth-profiles/order.js"; import type { AuthProfileStore } from "./auth-profiles/types.js"; @@ -42,6 +39,31 @@ function makeApiKeyProfilesByProviderProvider( ); } +const ANTHROPIC_STORE = { + version: 1, + profiles: { + "anthropic:default": { + type: "api_key", + provider: "anthropic", + key: "sk-default", + }, + "anthropic:work": { + type: "api_key", + provider: "anthropic", + key: "sk-work", + }, + }, +} satisfies AuthProfileStore; + +const ANTHROPIC_CFG = { + auth: { + profiles: { + "anthropic:default": { provider: "anthropic", mode: "api_key" }, + "anthropic:work": { provider: "anthropic", mode: "api_key" }, + }, + }, +} satisfies OpenClawConfig; + describe("resolveAuthProfileOrder", () => { const store = ANTHROPIC_STORE; const cfg = ANTHROPIC_CFG; diff --git a/src/agents/auth-profiles.resolve-auth-profile-order.fixtures.ts b/src/agents/auth-profiles.resolve-auth-profile-order.fixtures.ts deleted file mode 100644 index 23dfadb7ea79..000000000000 --- a/src/agents/auth-profiles.resolve-auth-profile-order.fixtures.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Shared auth profile ordering fixtures. - * Keeps provider/profile config fixtures aligned across ordering regression - * tests without coupling them to production store loading. - */ -import type { OpenClawConfig } from "../config/types.openclaw.js"; -import type { AuthProfileStore } from "./auth-profiles.js"; - -export const ANTHROPIC_STORE: AuthProfileStore = { - version: 1, - profiles: { - "anthropic:default": { - type: "api_key", - provider: "anthropic", - key: "sk-default", - }, - "anthropic:work": { - type: "api_key", - provider: "anthropic", - key: "sk-work", - }, - }, -}; - -export const ANTHROPIC_CFG: OpenClawConfig = { - auth: { - profiles: { - "anthropic:default": { provider: "anthropic", mode: "api_key" }, - "anthropic:work": { provider: "anthropic", mode: "api_key" }, - }, - }, -};