diff --git a/frontend/src/pages/AlphaPage.tsx b/frontend/src/pages/AlphaPage.tsx index 7bf5f1d..4e0ec68 100644 --- a/frontend/src/pages/AlphaPage.tsx +++ b/frontend/src/pages/AlphaPage.tsx @@ -15,6 +15,7 @@ import { Tag, TextArea, Toast, + Typography, } from "@douyinfe/semi-ui-19"; import type { ColumnProps } from "@douyinfe/semi-ui-19/lib/es/table/interface"; import { @@ -487,9 +488,25 @@ export function AlphaPage({ title: "失败项", width: 230, render: (_, row) => ( - + {row!.failed_checks?.join("、") || "—"} - + ), }, { diff --git a/frontend/tests/alpha-management.spec.ts b/frontend/tests/alpha-management.spec.ts index ef0d6fa..be39e3f 100644 --- a/frontend/tests/alpha-management.spec.ts +++ b/frontend/tests/alpha-management.spec.ts @@ -5,6 +5,20 @@ test("submission tabs, day selection, local correlation and reload", async ({ }) => { const errors: string[] = []; page.on("pageerror", (error) => errors.push(error.message)); + const failedChecks = [ + "LOW_SHARPE", + "LOW_FITNESS", + "LOW_GLB_AMER_SHARPE", + "LOW_GLB_EMEA_SHARPE", + "LOW_GLB_APAC_SHARPE", + "LOW_2Y_SHARPE", + ]; + await page.route("**/api/v1/alphas?*", async (route) => { + const response = await route.fetch(); + const data = await response.json(); + if (data.items?.length) data.items[0].failed_checks = failedChecks; + await route.fulfill({ response, json: data }); + }); await page.goto("/#alphas"); await page.getByLabel("密码", { exact: true }).fill("browser-test-password"); await page.getByRole("button", { name: "进入工作空间" }).click(); @@ -70,6 +84,17 @@ test("submission tabs, day selection, local correlation and reload", async ({ await page.getByRole("textbox", { name: "搜索 Alpha" }).fill("TEST0003"); await page.getByRole("button", { name: "查询", exact: true }).click(); await expect(page.locator(".alpha-link")).toHaveCount(1); + const failedCell = page.locator(".alpha-failed-checks"); + await failedCell.scrollIntoViewIfNeeded(); + expect((await failedCell.boundingBox())!.height).toBeLessThanOrEqual(24); + await failedCell.hover(); + await expect(page.getByRole("tooltip")).toHaveText(failedChecks.join("\n")); + await page.screenshot({ + path: "../output/playwright/alpha-failed-checks-tooltip.png", + animations: "disabled", + }); + await page.getByRole("tab", { name: "待提交", exact: true }).hover(); + await page.getByRole("tab", { name: "待提交", exact: true }).click(); await expect(page.getByRole("textbox", { name: "搜索 Alpha" })).toHaveValue( "",