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:
@@ -1,19 +1,28 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { Users } from "lucide-react";
|
||||
import { listTalents } from "@/lib/api-v2";
|
||||
import { PageContainer, Badge } from "@/components/shared/PageContainer";
|
||||
import { LoadingSpinner } from "@/components/shared/LoadingSpinner";
|
||||
import { EmptyState } from "@/components/shared/EmptyState";
|
||||
|
||||
/** 人才项。 */
|
||||
interface Talent {
|
||||
name: string;
|
||||
current_role: string;
|
||||
performance_rating?: string;
|
||||
potential_rating?: string;
|
||||
nine_box?: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export default function TalentsPage() {
|
||||
const [items, setItems] = useState<Record<string, any>[]>([]);
|
||||
const [items, setItems] = useState<Talent[]>([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
listTalents()
|
||||
.then((resp) => setItems((resp.data as Record<string, any>[]) ?? []))
|
||||
.then((resp) => setItems((resp.data as Talent[]) ?? []))
|
||||
.catch(() => setItems([]))
|
||||
.finally(() => setIsLoading(false));
|
||||
}, []);
|
||||
@@ -40,12 +49,12 @@ export default function TalentsPage() {
|
||||
<tbody className="divide-y divide-gray-100 bg-white">
|
||||
{items.map((item, i) => (
|
||||
<tr key={i}>
|
||||
<td className="px-4 py-2 text-gray-900">{item.name as string}</td>
|
||||
<td className="px-4 py-2 text-gray-600">{item.current_role as string}</td>
|
||||
<td className="px-4 py-2 text-gray-600">{item.performance_rating as string ?? "-"}</td>
|
||||
<td className="px-4 py-2 text-gray-600">{item.potential_rating as string ?? "-"}</td>
|
||||
<td className="px-4 py-2"><Badge color="blue">{item.nine_box as string ?? "-"}</Badge></td>
|
||||
<td className="px-4 py-2"><Badge color={item.status === "active" ? "green" : "gray"}>{item.status as string}</Badge></td>
|
||||
<td className="px-4 py-2 text-gray-900">{item.name}</td>
|
||||
<td className="px-4 py-2 text-gray-600">{item.current_role}</td>
|
||||
<td className="px-4 py-2 text-gray-600">{item.performance_rating ?? "-"}</td>
|
||||
<td className="px-4 py-2 text-gray-600">{item.potential_rating ?? "-"}</td>
|
||||
<td className="px-4 py-2"><Badge color="blue">{item.nine_box ?? "-"}</Badge></td>
|
||||
<td className="px-4 py-2"><Badge color={item.status === "active" ? "green" : "gray"}>{item.status}</Badge></td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user