fix: Alpha 列表失败项单行省略并提供完整提示

This commit is contained in:
yuxuanhui
2026-09-10 14:09:39 +08:00
parent ac92b3e70b
commit f8e23dccb9
2 changed files with 44 additions and 2 deletions
+25
View File
@@ -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(
"",