mirror of
https://github.com/bretzel-app/crumbs.git
synced 2026-10-12 12:06:57 +02:00
fix: preserve local-only notes during loadNotes merge
mergeNotesByVersion only iterated incoming notes, dropping any local-only notes (e.g. just created but not yet in the server/IDB response). This caused note cards to disappear briefly after creation when loadNotes raced with createNote. Also rename E2E test note title to avoid name collision with existing "Groceries" test. https://claude.ai/code/session_01TdPpATUkmdY7DhBkmqrvWs
This commit is contained in:
@@ -62,10 +62,10 @@ test.describe('Checklist', () => {
|
||||
|
||||
test('Scenario: Multiple checked items persist after closing and reopening', async ({ authenticatedPage: page }) => {
|
||||
// Given a checklist note with three items exists
|
||||
await createChecklistNote(page, 'Groceries', ['Milk', 'Eggs', 'Bread']);
|
||||
await createChecklistNote(page, 'Weekly Shop', ['Milk', 'Eggs', 'Bread']);
|
||||
|
||||
// When the user reopens and checks two items
|
||||
await noteCard(page, 'Groceries').click();
|
||||
await noteCard(page, 'Weekly Shop').click();
|
||||
await page.getByTestId('checklist-checkbox').nth(0).click(); // Milk → done
|
||||
await page.getByTestId('checklist-checkbox').nth(0).click(); // Eggs (now first) → done
|
||||
|
||||
@@ -74,7 +74,7 @@ test.describe('Checklist', () => {
|
||||
await page.getByTestId('close-editor-btn').click();
|
||||
|
||||
// And the checked state persists after reopening
|
||||
await noteCard(page, 'Groceries').click();
|
||||
await noteCard(page, 'Weekly Shop').click();
|
||||
await expect(page.getByTestId('checklist-toggle-done')).toContainText('2 done');
|
||||
await expect(page.getByTestId('checklist-input')).toHaveCount(1); // Only Bread remains active
|
||||
await expect(page.getByTestId('checklist-input').first()).toHaveValue('Bread');
|
||||
|
||||
Reference in New Issue
Block a user