test(web): align performance all-window label (#1685)

This commit is contained in:
Lyon
2026-06-20 11:00:42 +08:00
committed by GitHub
parent 747ab0b5b6
commit 5e7224c666
2 changed files with 3 additions and 3 deletions
@@ -557,7 +557,7 @@ function fakePerformanceWindow(value: string | null): FakePerformanceWindow {
"1h": { label: "最近 1 小时", seconds: 3600, windowFrom: "2026-06-18T03:30:00.000Z" },
"6h": { label: "最近 6 小时", seconds: 21600, windowFrom: "2026-06-17T22:30:00.000Z" },
"24h": { label: "最近 24 小时", seconds: 86400, windowFrom: "2026-06-17T04:30:00.000Z" },
all: { label: "全部样本", seconds: null, windowFrom: null }
all: { label: "全部累计", seconds: null, windowFrom: null }
};
const spec = specs[id] ?? { label: "最近 15 分钟", seconds: 900, windowFrom: "2026-06-18T04:15:00.000Z" };
return { id, generatedAt, windowTo: generatedAt, ...spec };
@@ -64,7 +64,7 @@ test("performance dashboard renders Chinese charts and keeps drill-down reachabl
{ tab: "1 小时", windowId: "1h", label: "最近 1 小时" },
{ tab: "6 小时", windowId: "6h", label: "最近 6 小时" },
{ tab: "24 小时", windowId: "24h", label: "最近 24 小时" },
{ tab: "全部", windowId: "all", label: "全部样本" }
{ tab: "全部", windowId: "all", label: "全部累计" }
];
for (const item of windowChecks) {
await page.getByRole("tab", { name: item.tab, exact: true }).click();
@@ -76,7 +76,7 @@ test("performance dashboard renders Chinese charts and keeps drill-down reachabl
const allRequestsBeforeRefresh = countWindowRequests(summaryRequests, "all");
await page.getByLabel("采集新鲜度").getByRole("button", { name: "刷新" }).click();
await expect.poll(async () => countWindowRequests(await performanceSummaryRequests(page), "all")).toBeGreaterThan(allRequestsBeforeRefresh);
await expect(page.locator(".performance-contract-item").filter({ hasText: "观测窗口" })).toContainText("全部样本");
await expect(page.locator(".performance-contract-item").filter({ hasText: "观测窗口" })).toContainText("全部累计");
await page.screenshot({ path: ".state/workbench-e2e/performance-dashboard-desktop.png", fullPage: true });