test: align preset tests with Kimi K2.7 and Fable model tiers

Update the Codex chat preset test's Kimi expectation (kimi-k2.6 -> kimi-k2.7-code) after the Kimi K2.7 upgrade, update the Claude Desktop form test for the four-tier (Sonnet/Opus/Fable/Haiku) routes, and reformat UsageDateRangePicker imports (prettier).
This commit is contained in:
Jason
2026-06-13 23:16:11 +08:00
parent efbb52a3fc
commit 3bb17434fb
3 changed files with 21 additions and 12 deletions
@@ -1,6 +1,11 @@
import { useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { CalendarDays, ChevronDown, ChevronLeft, ChevronRight } from "lucide-react";
import {
CalendarDays,
ChevronDown,
ChevronLeft,
ChevronRight,
} from "lucide-react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import {
@@ -49,7 +49,7 @@ describe("ClaudeDesktopProviderForm", () => {
},
});
// 固定档(Sonnet / Opus / Haiku)下有个菜单显示名输入,取 Sonnet(首个)。
// 固定档(Sonnet / Opus / Fable / Haiku)下有个菜单显示名输入,取 Sonnet(首个)。
const input = screen.getAllByPlaceholderText(
"DeepSeek V4 Pro",
)[0] as HTMLInputElement;
@@ -115,7 +115,11 @@ describe("ClaudeDesktopProviderForm", () => {
});
// 固定四档:每档各一个「菜单显示名」输入框,无论初始只配了几档。
expect(screen.getAllByPlaceholderText("DeepSeek V4 Pro")).toHaveLength(4);
// Haiku 档的占位示例是 "DeepSeek V4 Flash"、其余三档是 "DeepSeek V4 Pro"
// (见组件的 role-consistent 占位逻辑),故用正则同时匹配两种占位、数满四档。
expect(
screen.getAllByPlaceholderText(/DeepSeek V4 (Pro|Flash)/),
).toHaveLength(4);
});
it("代理模式初始无路由且默认路由未就绪时不渲染空四档", () => {
@@ -177,14 +181,14 @@ describe("ClaudeDesktopProviderForm", () => {
"claude-fable-5": { model: "upstream-old" },
"claude-haiku-4-5": { model: "upstream-old" },
});
expect(
Object.keys(submitted.meta.claudeDesktopModelRoutes).sort(),
).toEqual([
"claude-fable-5",
"claude-haiku-4-5",
"claude-opus-4-8",
"claude-sonnet-4-6",
]);
expect(Object.keys(submitted.meta.claudeDesktopModelRoutes).sort()).toEqual(
[
"claude-fable-5",
"claude-haiku-4-5",
"claude-opus-4-8",
"claude-sonnet-4-6",
],
);
});
it("回填空档时继承 Sonnet 的 1M 声明", async () => {
@@ -76,7 +76,7 @@ const expectedChatPresets = new Map<
"Kimi",
{
baseUrl: "https://api.moonshot.cn/v1",
contextWindows: { "kimi-k2.6": 262144 },
contextWindows: { "kimi-k2.7-code": 262144 },
},
],
[