test(frontend): UIUX E2E 测试 — 新增路由导航/创始人端/Admin端/工作台/移动端适配

新增 6 个 E2E 测试文件,覆盖 2-task-uiux.md 全部 50 项任务:
- uiux-navigation.spec.ts: 8 tests (today/compare/threads/workspace/ooda/ai-plus/profiles)
- sidebar-navigation.spec.ts: 6 tests (投资人 Sidebar 6 业务域)
- founder-uiux.spec.ts: 7 tests (创始人端 6 域导航)
- admin-uiux.spec.ts: 3 tests (Admin 6 管理域 + 商业秘密保护)
- workbench-uiux.spec.ts: 5 tests (Highlights/WorkMode/Tab/InsightRail)
- mobile-uiux.spec.ts: 5 tests (移动端抽屉导航 + 创始人底部导航)

同时修复全部 no-explicit-any 警告,替换为 TypeScript 接口定义。

测试结果: 41 E2E passed, 405 backend passed
This commit is contained in:
selfrelease
2026-07-19 20:37:25 +08:00
parent 3a905da35b
commit f4ddcab2ca
62 changed files with 1549 additions and 369 deletions
@@ -1,19 +1,27 @@
"use client";
import { useEffect, useState } from "react";
import { ScrollText, Plus } from "lucide-react";
import {Plus } from "lucide-react";
import { listAgreements } from "@/lib/api-v2";
import { PageContainer, Badge, TableEmpty } from "@/components/shared/PageContainer";
import { LoadingSpinner } from "@/components/shared/LoadingSpinner";
import { EmptyState } from "@/components/shared/EmptyState";
/** 投资协议项。 */
interface Agreement {
title: string;
signed_at: string;
status: string;
key_clauses?: unknown[];
}
export default function AgreementsPage() {
const [items, setItems] = useState<Record<string, any>[]>([]);
const [items, setItems] = useState<Agreement[]>([]);
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
listAgreements()
.then((resp) => setItems((resp.data as Record<string, any>[]) ?? []))
.then((resp) => setItems((resp.data as Agreement[]) ?? []))
.catch(() => setItems([]))
.finally(() => setIsLoading(false));
}, []);
@@ -49,15 +57,15 @@ export default function AgreementsPage() {
) : (
items.map((item, i) => (
<tr key={i}>
<td className="px-4 py-2 text-gray-900">{item.title as string}</td>
<td className="px-4 py-2 text-gray-600">{item.signed_at as string}</td>
<td className="px-4 py-2 text-gray-900">{item.title}</td>
<td className="px-4 py-2 text-gray-600">{item.signed_at}</td>
<td className="px-4 py-2">
<Badge color={item.status === "active" ? "green" : "gray"}>
{item.status as string}
{item.status}
</Badge>
</td>
<td className="px-4 py-2 text-gray-500">
{Array.isArray(item.key_clauses) ? (item.key_clauses as unknown[]).length : 0}
{Array.isArray(item.key_clauses) ? item.key_clauses.length : 0}
</td>
</tr>
))