fix: compact collapsed agent rail

This commit is contained in:
2026-07-21 14:51:59 +08:00
parent ebe6cdc7f1
commit e0cfa3d6eb
2 changed files with 16 additions and 1 deletions
+15
View File
@@ -25,6 +25,21 @@ test("Agent panel resizes by drag without exceeding half the viewport", async ({
await expect.poll(async () => (await panel.boundingBox())?.width).toBe(476);
});
test("collapsed Agent rail is compact and expands as one clear action", async ({ page }) => {
await page.goto("/", { waitUntil: "networkidle" });
await page.getByRole("button", { name: "折叠 Agent 面板" }).click();
const rail = page.locator('aside[aria-label="Agent 折叠栏"]');
const expandButton = page.getByRole("button", { name: /展开排水助手面板/ });
await expect(rail).toBeVisible();
await expect(rail).toHaveCSS("width", "72px");
await expect(expandButton).toHaveAttribute("title", /当前|正在/);
await expandButton.click();
await expect(page.locator('aside[aria-label="Agent 命令面板"]')).toBeVisible();
});
test("Agent resize handle stays hidden in the mobile layout", async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto("/", { waitUntil: "domcontentloaded" });