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) <noreply@anthropic.com>
This commit is contained in:
lucaronin
2026-03-24 17:59:16 +01:00
parent c6cb1ea4f7
commit 0d32735976
2 changed files with 7 additions and 8 deletions

View File

@@ -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 })
})
})

View File

@@ -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([])
})