settingsModelProviderUpgradeIntent.test.ts 1.3 KB

123456789101112131415161718192021222324252627282930
  1. import { describe, expect, it } from "vitest";
  2. import { BUILTIN_MODEL_PROVIDER_IDS } from "@zcode/shared";
  3. import {
  4. normalizeCodingPlanProviderId,
  5. resolveCodingPlanOAuthProviderId,
  6. } from "@/settings/model-provider-section/codingPlanPurchaseAuth.js";
  7. import { CODING_PLAN_PROVIDER_SPECS } from "@/settings/model-provider-section/constants.js";
  8. describe("settings model provider upgrade intent", () => {
  9. it("keeps both Team Provider identities in the Coding Plan upgrade boundary", () => {
  10. expect(normalizeCodingPlanProviderId(BUILTIN_MODEL_PROVIDER_IDS.zaiTeamCodingPlan)).toBe(
  11. BUILTIN_MODEL_PROVIDER_IDS.zaiTeamCodingPlan,
  12. );
  13. expect(normalizeCodingPlanProviderId(BUILTIN_MODEL_PROVIDER_IDS.bigmodelTeamCodingPlan)).toBe(
  14. BUILTIN_MODEL_PROVIDER_IDS.bigmodelTeamCodingPlan,
  15. );
  16. expect(resolveCodingPlanOAuthProviderId(BUILTIN_MODEL_PROVIDER_IDS.zaiTeamCodingPlan)).toBe(
  17. "zai",
  18. );
  19. expect(
  20. resolveCodingPlanOAuthProviderId(BUILTIN_MODEL_PROVIDER_IDS.bigmodelTeamCodingPlan),
  21. ).toBe("bigmodel");
  22. expect(CODING_PLAN_PROVIDER_SPECS.map((spec) => spec.id)).not.toContain(
  23. BUILTIN_MODEL_PROVIDER_IDS.zaiTeamCodingPlan,
  24. );
  25. expect(CODING_PLAN_PROVIDER_SPECS.map((spec) => spec.id)).not.toContain(
  26. BUILTIN_MODEL_PROVIDER_IDS.bigmodelTeamCodingPlan,
  27. );
  28. });
  29. });