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
+23 -10
View File
@@ -1,23 +1,36 @@
"use client";
import { useEffect, useState } from "react";
import { AlertTriangle } from "lucide-react";
import { listMajorEvents, listInquiries } from "@/lib/api-v2";
import { PageContainer, Badge } from "@/components/shared/PageContainer";
import { LoadingSpinner } from "@/components/shared/LoadingSpinner";
import { EmptyState } from "@/components/shared/EmptyState";
/** 重大事项项。 */
interface MajorEvent {
event_type: string;
title: string;
severity: string;
description?: string;
}
/** 追问清单项。 */
interface Inquiry {
status: string;
questions?: unknown[];
}
export default function EventsPage() {
const [events, setEvents] = useState<Record<string, any>[]>([]);
const [inquiries, setInquiries] = useState<Record<string, any>[]>([]);
const [events, setEvents] = useState<MajorEvent[]>([]);
const [inquiries, setInquiries] = useState<Inquiry[]>([]);
const [isLoading, setIsLoading] = useState(true);
const [tab, setTab] = useState<"events" | "inquiries">("events");
useEffect(() => {
Promise.all([listMajorEvents(), listInquiries()])
.then(([e, i]) => {
setEvents((e.data as Record<string, any>[]) ?? []);
setInquiries((i.data as Record<string, any>[]) ?? []);
setEvents((e.data as MajorEvent[]) ?? []);
setInquiries((i.data as Inquiry[]) ?? []);
})
.catch(() => {
setEvents([]);
@@ -54,14 +67,14 @@ export default function EventsPage() {
<div key={i} className="rounded-lg border border-gray-200 bg-white p-4">
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<Badge color="blue">{item.event_type as string}</Badge>
<h3 className="font-medium text-gray-900">{item.title as string}</h3>
<Badge color="blue">{item.event_type}</Badge>
<h3 className="font-medium text-gray-900">{item.title}</h3>
</div>
<Badge color={item.severity === "critical" ? "red" : item.severity === "high" ? "amber" : "gray"}>
{item.severity as string}
{item.severity}
</Badge>
</div>
{item.description && <p className="mt-2 text-sm text-gray-600">{item.description as string}</p>}
{item.description && <p className="mt-2 text-sm text-gray-600">{item.description}</p>}
</div>
))}
</div>
@@ -76,7 +89,7 @@ export default function EventsPage() {
<div className="flex items-center justify-between">
<h3 className="font-medium text-gray-900"></h3>
<Badge color={item.status === "answered" ? "green" : item.status === "closed" ? "gray" : "amber"}>
{item.status as string}
{item.status}
</Badge>
</div>
<div className="mt-2 space-y-1">