fix: improve mobile workbench controls

This commit is contained in:
2026-07-21 12:35:36 +08:00
parent caf06a8a82
commit ebe6cdc7f1
11 changed files with 144 additions and 62 deletions
+19
View File
@@ -0,0 +1,19 @@
import { expect, test } from "playwright/test";
test("map notice is centered in the mobile viewport", async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto("/", { waitUntil: "networkidle" });
await page.getByRole("button", { name: "打开用户菜单" }).click();
await page.getByRole("menuitem", { name: /查看运行状态/ }).click();
const notice = page.locator('[role="status"]').filter({ hasText: "数据状态" }).first();
await expect(notice).toBeVisible();
const box = await notice.boundingBox();
expect(box).not.toBeNull();
const leftInset = Math.round(box!.x);
const rightInset = Math.round(375 - box!.x - box!.width);
expect(Math.abs(leftInset - rightInset)).toBeLessThanOrEqual(1);
});