test(providers): share onboard primary assertions

This commit is contained in:
Vincent Koc
2026-04-12 04:19:54 +01:00
parent 54c45ae9ca
commit 17bdc76d90
4 changed files with 48 additions and 76 deletions

View File

@@ -43,6 +43,16 @@ export function expectProviderOnboardPrimaryAndFallbacks(params: {
]);
}
export function expectProviderOnboardPreservesPrimary(params: {
applyProviderConfig: (config: OpenClawConfig) => OpenClawConfig;
primaryModelRef: string;
}) {
const cfg = params.applyProviderConfig({
agents: { defaults: { model: { primary: params.primaryModelRef } } },
});
expect(resolveAgentModelPrimaryValue(cfg.agents?.defaults?.model)).toBe(params.primaryModelRef);
}
export function expectProviderOnboardMergedLegacyConfig(params: {
applyProviderConfig: (config: OpenClawConfig) => OpenClawConfig;
providerId: string;