1
0
forked from boos/BoosAPI

feat(tests): add comprehensive tests for TokenRouter and related components

- Implement tests for TokenRouter downstream policy, covering allowedRouteIds and site weight multipliers.
- Add tests for TokenRouter patterns and model mapping, including regex pattern matching and model mapping precedence.
- Create tests for BrandIcon component to verify brand detection logic.
- Develop tests for Accounts page, focusing on rebind panel behavior and refresh action on error.
- Introduce fuzzy search utility tests to validate substring and subsequence matching.
- Implement navigation focus helpers tests for building and parsing focus paths.
- Add progressive render tests to ensure correct initial and next visible counts.
- Create route model candidates index tests to validate route candidate indexing and matching logic.
This commit is contained in:
cita
2026-03-02 13:33:35 +08:00
parent 99c9e145c3
commit f6389a999a
98 changed files with 11286 additions and 801 deletions
+13 -3
View File
@@ -326,8 +326,12 @@ export const zhToEnSupplemental: Record<string, string> = {
'模型广场刷新完成:新增路由 ${rebuild.createdRoutes},新增通道 ${rebuild.createdChannels},移除通道 ${rebuild.removedChannels}': 'The model square refresh is completed: add route ${rebuild.createdRoutes}, add channel ${rebuild.createdChannels}, remove channel ${rebuild.removedChannels}',
'模型广场刷新已完成': 'Model square refresh has been completed',
'模型路由': 'model routing',
'群组': 'groups',
'全部群组': 'all groups',
'群组路由': 'group routes',
'查看群组路由': 'viewing group routes',
'模型名称': 'Model name',
'模型匹配(如 gpt-4o、claude-*)': 'Model matching (such as gpt-4o, claude-*)',
'模型匹配(如 gpt-4o、claude-*、re:^claude-.*$)': 'Model matching (such as gpt-4o, claude-*, re:^claude-.*$)',
'模型已更新': 'Model updated',
'模型映射 JSON(可选)': 'Model mapping JSON (optional)',
'默认': 'default',
@@ -487,6 +491,7 @@ export const zhToEnSupplemental: Record<string, string> = {
'刷新状态中...': 'Refreshing status...',
'思考中...': 'Thinking...',
'松开以导入文件': 'Release to import file',
'搜索': 'Search',
'搜索 (Ctrl+K)': 'Search (Ctrl+K)',
'搜索模型(支持名称片段)': 'Search model (supports name fragments)',
'搜索模型路由...': 'Search model routes...',
@@ -511,6 +516,7 @@ export const zhToEnSupplemental: Record<string, string> = {
'通道已添加': 'Channel added',
'通道已移除': 'Channel removed',
'通配符路由按请求实时决策;概率解释仅在精确模型路由中展示。': 'Wildcard routing makes real-time decisions on a per-request basis; probabilistic interpretation is only shown in exact model routing.',
'通配符路由按请求实时决策;概率解释在当前路由内统一估算。': 'Wildcard routing makes real-time decisions on a per-request basis; probabilistic interpretation is estimated uniformly within the current route.',
'通义千问': 'Tongyi Qianwen',
'通知': 'notify',
'通知发送失败:${failedResults[0].error}': 'Notification sending failed: ${failedResults[0].error}',
@@ -525,7 +531,7 @@ export const zhToEnSupplemental: Record<string, string> = {
'同步失败': 'Sync failed',
'同步失败:${resolveSyncMessage(res, \'请检查账号令牌或站点状态\')}': 'Sync failed: ${resolveSyncMessage(res, \'请检查账号令牌或站点状态\')}',
'同步完成:新增 ${res.created || 0},更新 ${res.updated || 0}': 'Synchronization completed: new ${res.created || 0}, updated ${res.updated || 0}',
'同步已跳过:${resolveSyncMessage(res, \'账号缺少可用会话令牌\')}': 'Sync skipped: ${resolveSyncMessage(res, \'账号缺少可用会话令牌\')}',
'同步已跳过:${resolveSyncMessage(res, \'账号缺少可用 Session Cookie\')}': 'Sync skipped: ${resolveSyncMessage(res, \'账号缺少可用 Session Cookie\')}',
'同步站点令牌': 'Sync site token',
'同步站点令牌失败': 'Failed to sync site token',
'统一代理网关': 'Unified proxy gateway',
@@ -655,7 +661,11 @@ export const zhToEnSupplemental: Record<string, string> = {
'暂无通知': 'No notification yet',
'粘贴 JSON 数据或通过上面的拖拽区域导入...': 'Paste JSON data or import via the drag area above...',
'粘贴 ld_auth_session 或 ld_auth_session=xxx': 'Paste ld_auth_session or ld_auth_session=xxx',
'粘贴 Session Token 或 API Key&#10;(系统会自动识别 Token 类型)': 'Paste Session Token or API Key (The system will automatically identify the Token type)',
'粘贴 Session Cookie 或 API Key&#10;(系统会自动识别凭证类型)': 'Paste Session Cookie or API Key (The system will automatically identify credential type)',
'支持两种凭证类型,系统自动识别': 'Supports two credential types; auto-detected by the system',
'获取 Session Cookie:': 'Get Session Cookie:',
'Session Cookie 有效': 'Session Cookie is valid',
'账号缺少可用 Session Cookie': 'No available Session Cookie for this account',
'展开': 'Expand',
'展开高级参数': 'Expand advanced parameters',
'占用统计已清理': 'Occupancy statistics cleared',