offPeakModelSelection.test.ts 905 B

123456789101112131415161718192021222324
  1. import { describe, expect, it } from "vitest";
  2. import { buildOffPeakSubmissionModelSelection } from "../src/settings/OffPeakEditView.js";
  3. describe("buildOffPeakSubmissionModelSelection", () => {
  4. it("persists the displayed reasoning level for every new task Selection", () => {
  5. expect(
  6. buildOffPeakSubmissionModelSelection("account:zai-offpeak-idle-plan", "GLM-5.2", "high"),
  7. ).toEqual({
  8. providerId: "account:zai-offpeak-idle-plan",
  9. modelId: "GLM-5.2",
  10. options: { reasoningLevel: "high" },
  11. });
  12. });
  13. it("preserves an explicitly selected value even when it equals the Config default", () => {
  14. expect(
  15. buildOffPeakSubmissionModelSelection("account:bigmodel-offpeak-idle-plan", "GLM-5.2", "high"),
  16. ).toEqual({
  17. providerId: "account:bigmodel-offpeak-idle-plan",
  18. modelId: "GLM-5.2",
  19. options: { reasoningLevel: "high" },
  20. });
  21. });
  22. });