Fix E2E note save: use el.blur() and wait for textarea to disappear
sidebar h2 click doesn't reliably blur the textarea in headless Chrome. el.blur() directly fires the native blur event; waiting for textarea to disappear confirms onBlur executed and the note was saved to Yjs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1ad5c6be52
commit
e9e80c4e54
1 changed files with 8 additions and 5 deletions
|
|
@ -496,13 +496,16 @@ test.describe("Planner", () => {
|
||||||
await expect(textarea).toBeVisible({ timeout: 3000 });
|
await expect(textarea).toBeVisible({ timeout: 3000 });
|
||||||
await textarea.fill("Refill water here");
|
await textarea.fill("Refill water here");
|
||||||
|
|
||||||
// Click elsewhere to blur and save the note
|
// Blur the textarea directly to trigger the onBlur save handler
|
||||||
await sidebar.locator("h2").click();
|
await textarea.evaluate((el) => el.blur());
|
||||||
|
|
||||||
// Note should now be displayed (no longer placeholder)
|
// Wait for the textarea to disappear (confirms onBlur fired and editingNoteIndex reset)
|
||||||
|
await expect(textarea).not.toBeVisible({ timeout: 3000 });
|
||||||
|
|
||||||
|
// Note should now be displayed as static text
|
||||||
await expect(firstRow.getByText("Refill water here")).toBeVisible({ timeout: 3000 });
|
await expect(firstRow.getByText("Refill water here")).toBeVisible({ timeout: 3000 });
|
||||||
// Give Yjs a moment to flush the transaction
|
// Allow Yjs transaction to flush
|
||||||
await page.waitForTimeout(300);
|
await page.waitForTimeout(500);
|
||||||
|
|
||||||
// Open the export dropdown (▾ chevron next to Export GPX), then click Export Plan
|
// Open the export dropdown (▾ chevron next to Export GPX), then click Export Plan
|
||||||
await page.getByRole("button", { name: "▾" }).click();
|
await page.getByRole("button", { name: "▾" }).click();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue