|
|
@@ -15,16 +15,18 @@ describe("sortModelOptions", () => {
|
|
|
expect(sorted.map((model) => model.title)).toEqual(["GPT 5.4", "GPT 5.2", "GPT 5.1"])
|
|
|
})
|
|
|
|
|
|
- test("preserves free-first alphabetical ordering for the regular picker", () => {
|
|
|
+ test("orders regular model choices free-first and then newest-first", () => {
|
|
|
const sorted = sortModelOptions(
|
|
|
[
|
|
|
- { title: "Beta", releaseDate: "2026-01-01" },
|
|
|
- { title: "Alpha", releaseDate: "2025-01-01", footer: "Free" },
|
|
|
- { title: "Gamma", releaseDate: "2024-01-01", footer: "Free" },
|
|
|
+ { title: "GLM 5", releaseDate: "2025-07-28" },
|
|
|
+ { title: "GLM 5.1", releaseDate: "2025-12-09" },
|
|
|
+ { title: "GLM 5.2", releaseDate: "2026-02-16" },
|
|
|
+ { title: "Free old", releaseDate: "2024-01-01", footer: "Free" },
|
|
|
+ { title: "Free new", releaseDate: "2025-01-01", footer: "Free" },
|
|
|
],
|
|
|
false,
|
|
|
)
|
|
|
|
|
|
- expect(sorted.map((model) => model.title)).toEqual(["Alpha", "Gamma", "Beta"])
|
|
|
+ expect(sorted.map((model) => model.title)).toEqual(["Free new", "Free old", "GLM 5.2", "GLM 5.1", "GLM 5"])
|
|
|
})
|
|
|
})
|