fix: keep preview retry controls stationary during pointer activation

This commit is contained in:
cesnimda
2026-10-24 23:31:58 +02:00
parent e80815f8df
commit b313e20bad
8 changed files with 79 additions and 4 deletions
@@ -192,7 +192,11 @@ for (const [mode, language] of [["light", "en"], ["dark", "nb"], ["light", "nb"]
await expect(frame.getByText("Reviewed CV-only æøå", { exact: true })).toBeVisible();
await page.getByText(t.cvEditorPreviewUnavailable, { exact: true }).evaluate(node => node.scrollIntoView({ block: "center" }));
await capture(page, info, `error-${suffix}`);
await page.getByRole("button", { name: t.cvEditorRetryPreview, exact: true }).click();
// A held pointer must keep its target even if focus handlers schedule a layout frame.
await page.getByRole("button", { name: t.cvEditorRetryPreview, exact: true }).hover();
await page.mouse.down();
await page.evaluate(() => new Promise<void>(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))));
await page.mouse.up();
await expect(frame.getByText("Canonical engineer", { exact: true })).toBeVisible();
await expect(page.getByText(t.cvEditorPreviewUnavailable, { exact: true })).not.toBeVisible();
await page.getByRole("button", { name: t.cvEditorRedo, exact: true }).click();