test(agents): inline auth profile ordering fixtures

This commit is contained in:
Vincent Koc 2026-06-17 17:56:13 +08:00
parent dc881a6a31
commit 366ef93641
No known key found for this signature in database
2 changed files with 26 additions and 36 deletions

View file

@ -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;

View file

@ -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" },
},
},
};