The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | import type { ProviderOptionDescriptor } from "@t3tools/contracts"; |
| 2 | import { describe, expect, it } from "vite-plus/test"; |
| 3 | |
| 4 | import { buildTraitsTriggerDisplay, getDescriptorStringValue } from "./modelTraits.ts"; |
| 5 | |
| 6 | describe("buildTraitsTriggerDisplay", () => { |
| 7 | it.each([ |
| 8 | { currentValue: undefined, defaultValue: undefined, value: null, label: "Thinking" }, |
| 9 | { currentValue: undefined, defaultValue: "high", value: "high", label: "High" }, |
| 10 | { currentValue: "low", defaultValue: undefined, value: "low", label: "Low" }, |
| 11 | { currentValue: "max", defaultValue: "high", value: "max", label: "Max" }, |
| 12 | { id: "effort", currentValue: undefined, defaultValue: undefined, value: null, label: "" }, |
| 13 | ])("labels Pi thinking without inventing a selection: $label ($value)", (input) => { |
| 14 | const descriptor: Extract<ProviderOptionDescriptor, { type: "select" }> = { |
| 15 | id: input.id ?? "thinking", |
| 16 | label: "Thinking", |
| 17 | type: "select", |
| 18 | options: ["low", "high", "max"].map((id) => ({ |
| 19 | id, |
| 20 | label: id[0]!.toUpperCase() + id.slice(1), |
| 21 | ...(id === input.defaultValue ? { isDefault: true } : {}), |
| 22 | })), |
| 23 | ...(input.currentValue ? { currentValue: input.currentValue } : {}), |
| 24 | }; |
| 25 | |
| 26 | expect( |
| 27 | buildTraitsTriggerDisplay({ |
| 28 | descriptors: [descriptor], |
| 29 | primarySelectDescriptorId: descriptor.id, |
| 30 | ultrathinkPromptControlled: false, |
| 31 | }).label, |
| 32 | ).toBe(input.label); |
| 33 | expect(getDescriptorStringValue(descriptor)).toBe(input.value); |
| 34 | }); |
| 35 | }); |