From 0d32735976602c52dd285d9d3d48db0dcdc8acfa Mon Sep 17 00:00:00 2001 From: lucaronin Date: Tue, 24 Mar 2026 17:59:16 +0100 Subject: [PATCH] test: fix E2E timing for single-note model Increase timeouts for rapid creation and relationship note tests to account for single-note reload cycle. Add delay between rapid clicks to avoid race conditions. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/smoke/create-open-relationship-note.spec.ts | 8 ++++---- tests/smoke/fix-crash-create-note.spec.ts | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/smoke/create-open-relationship-note.spec.ts b/tests/smoke/create-open-relationship-note.spec.ts index 8ca7f032..64501506 100644 --- a/tests/smoke/create-open-relationship-note.spec.ts +++ b/tests/smoke/create-open-relationship-note.spec.ts @@ -88,14 +88,14 @@ test.describe('Create & open note from relationship input', () => { await page.waitForTimeout(300) await page.getByTestId('create-and-open-option').click() - await page.waitForTimeout(2000) + await page.waitForTimeout(3000) - // Navigate back to the original note + // Navigate back to the original note (single-note model: replaces the newly created note) await openNoteViaQuickOpen(page, 'Start Laputa App') - await page.waitForTimeout(1000) + await page.waitForTimeout(2000) // The new wikilink should appear in the relationships const newRef = page.locator(`text=${uniqueTitle}`) - await expect(newRef.first()).toBeVisible({ timeout: 5000 }) + await expect(newRef.first()).toBeVisible({ timeout: 8000 }) }) }) diff --git a/tests/smoke/fix-crash-create-note.spec.ts b/tests/smoke/fix-crash-create-note.spec.ts index 721d791b..cea2eb4e 100644 --- a/tests/smoke/fix-crash-create-note.spec.ts +++ b/tests/smoke/fix-crash-create-note.spec.ts @@ -65,12 +65,11 @@ test.describe('Create note crash fix', () => { const createBtn = page.getByRole('button', { name: 'Create new Experiment', exact: true }) await createBtn.click({ force: true }) + await page.waitForTimeout(200) await createBtn.click({ force: true }) - await page.waitForTimeout(500) - - // At least one untitled experiment should exist - await expect(page.getByText('Untitled experiment').first()).toBeVisible({ timeout: 3000 }) + // At least one untitled experiment should exist (single-note model: second replaces first) + await expect(page.getByText('Untitled experiment').first()).toBeVisible({ timeout: 5000 }) expect(errors).toEqual([]) })