tests: fix vLLM onboarding selection

This commit is contained in:
gejifeng
2026-02-11 10:46:20 +00:00
committed by Peter Steinberger
parent d44c118334
commit 513fd835a1

View File

@@ -21,10 +21,12 @@ const ensureAuthProfileStore = vi.hoisted(() =>
);
const listProfilesForProvider = vi.hoisted(() => vi.fn(() => []));
const upsertAuthProfile = vi.hoisted(() => vi.fn());
const upsertAuthProfileWithLock = vi.hoisted(() => vi.fn(async () => {}));
vi.mock("../agents/auth-profiles.js", () => ({
ensureAuthProfileStore,
listProfilesForProvider,
upsertAuthProfile,
upsertAuthProfileWithLock,
}));
const resolveEnvApiKey = vi.hoisted(() => vi.fn(() => undefined));
@@ -99,9 +101,10 @@ describe("promptDefaultModel", () => {
includeManual: false,
includeVllm: true,
ignoreAllowlist: true,
agentDir: "/tmp/openclaw-agent",
});
expect(upsertAuthProfile).toHaveBeenCalledWith(
expect(upsertAuthProfileWithLock).toHaveBeenCalledWith(
expect.objectContaining({
profileId: "vllm:default",
credential: expect.objectContaining({ provider: "vllm" }),