From 0a5821d8ecefb0e2c4c69feabc5879765abef535 Mon Sep 17 00:00:00 2001 From: Zheng Li Date: Fri, 2 Oct 2026 06:35:39 +0800 Subject: [PATCH 1/2] test: verify card menu interaction states --- tests/playwright/card-actions.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/playwright/card-actions.spec.ts b/tests/playwright/card-actions.spec.ts index 8a0d12fd..89995fe8 100644 --- a/tests/playwright/card-actions.spec.ts +++ b/tests/playwright/card-actions.spec.ts @@ -107,7 +107,10 @@ for (const collection of ["grid", "list", "github", "x"] as const) { await page.keyboard.press("ArrowDown"); await expect(menu.getByRole("menuitem").nth(1)).toBeFocused(); await page.keyboard.press("Escape"); + await expect(menu).not.toBeVisible(); + await expect(more).toBeFocused(); await more.tap(); + await expect(menu).toBeVisible(); await page.touchscreen.tap(width - 5, 100); await expect(menu).not.toBeVisible(); await page.screenshot({ path: `.artifacts/card-actions-${collection}-${width}.png` }); From 5a2ee8d1bd485d4ac1f3db0b2c40cd5b529f4058 Mon Sep 17 00:00:00 2001 From: Zheng Li Date: Fri, 2 Oct 2026 06:51:27 +0800 Subject: [PATCH 2/2] test: await card entrance before scroll checks --- tests/playwright/card-actions.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/playwright/card-actions.spec.ts b/tests/playwright/card-actions.spec.ts index 89995fe8..72b13394 100644 --- a/tests/playwright/card-actions.spec.ts +++ b/tests/playwright/card-actions.spec.ts @@ -211,9 +211,10 @@ test("selection keeps a tall card stationary and Escape exits without scrolling" const choice = page.getByRole("checkbox", { name: "选择 Tall selection card" }); await expect(choice).toBeVisible(); const overlay = page.locator("label").filter({ has: choice }); - const point = await overlay.evaluate((el) => { + const point = await overlay.evaluate(async (el) => { const wrapper = el.parentElement; if (!wrapper) throw new Error("Missing selection wrapper"); + await Promise.all(wrapper.getAnimations().map((animation) => animation.finished)); wrapper.style.minHeight = "1400px"; let scroller = wrapper.parentElement; while (scroller && !/(auto|scroll)/.test(getComputedStyle(scroller).overflowY))