mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-03 20:09:33 +01:00
Verify deployment-configured model preferences with the selected account. Preserve structured provider failures and show descriptive messages for known causes through the existing onboarding error display. Keep the existing failure buttons, account binding, and retry/sign-in behavior. Validation: UI typecheck, 38 focused tests, four browser journeys, all applicable CI checks, and Greptile 5/5 with no unresolved review comments. Co-Authored-By: Paperclip <noreply@paperclip.ing>
17 lines
981 B
TypeScript
17 lines
981 B
TypeScript
import { expect, it } from "vitest";
|
|
import { onboardingModels } from "./onboarding-models.js";
|
|
|
|
it("leaves deployments without preferences on their normal adapter defaults", () => {
|
|
expect(onboardingModels({})).toEqual({});
|
|
});
|
|
it("reads fresh deployment preferences without provider or plan policy in Core", () => {
|
|
const env = { PAPERCLIP_ONBOARDING_MODELS: '{"example_local":["preferred","backup","preferred"]}' };
|
|
expect(onboardingModels(env)).toEqual({ example_local: ["preferred", "backup"] });
|
|
env.PAPERCLIP_ONBOARDING_MODELS = '{"example_local":["replacement"]}';
|
|
expect(onboardingModels(env)).toEqual({ example_local: ["replacement"] });
|
|
});
|
|
it.each(["null", "[]", "invalid", '{"adapter":[]}', '{"adapter":[1]}', '{"adapter":["https://private.example"]}',
|
|
'{"adapter":["one","two","three","four"]}', " ".repeat(8193)])("rejects malformed or unbounded preferences %#", raw => {
|
|
expect(onboardingModels({ PAPERCLIP_ONBOARDING_MODELS: raw })).toEqual({});
|
|
});
|