From f8e23dccb9c2de5eebf8a11b153682586306e228 Mon Sep 17 00:00:00 2001 From: yuxuanhui Date: Thu, 10 Sep 2026 14:09:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Alpha=20=E5=88=97=E8=A1=A8=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E9=A1=B9=E5=8D=95=E8=A1=8C=E7=9C=81=E7=95=A5=E5=B9=B6?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=E5=AE=8C=E6=95=B4=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/AlphaPage.tsx | 21 +++++++++++++++++++-- frontend/tests/alpha-management.spec.ts | 25 +++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) 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( "",