From 8155bd4ff565ba050dae9a4e301fcbf2595037f8 Mon Sep 17 00:00:00 2001 From: Frederic Cabassut Date: Sat, 21 Mar 2026 19:25:56 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20address=20PR=20review=20=E2=80=94=20uniq?= =?UTF-8?q?ue=20test=20titles=20and=20assertion=20between=20clicks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename "Groceries" to "Focus Test List" to avoid title collision - Add assertion (1 done) between consecutive checkbox clicks to prevent race condition where second click toggles the same item back Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/e2e/checklist.spec.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/e2e/checklist.spec.ts b/tests/e2e/checklist.spec.ts index 0127218..3d6266c 100644 --- a/tests/e2e/checklist.spec.ts +++ b/tests/e2e/checklist.spec.ts @@ -67,6 +67,7 @@ test.describe('Checklist', () => { // When the user reopens and checks two items await noteCard(page, 'Weekly Shop').click(); await page.getByTestId('checklist-checkbox').nth(0).click(); // Milk → done + await expect(page.getByTestId('checklist-toggle-done')).toContainText('1 done'); await page.getByTestId('checklist-checkbox').nth(0).click(); // Eggs (now first) → done // Then the done section shows two checked items @@ -97,17 +98,19 @@ test.describe('Checklist', () => { // Given a saved checklist note where checked items precede active items // (this happens when reopening a note — parseChecklist preserves the // saved order rather than grouping active items first) - await createChecklistNote(page, 'Groceries', ['Milk', 'Eggs', 'Bread', 'Butter']); + await createChecklistNote(page, 'Focus Test List', ['Milk', 'Eggs', 'Bread', 'Butter']); // Reopen and check items 1 and 2 so saved content has checked items first - await noteCard(page, 'Groceries').click(); + await noteCard(page, 'Focus Test List').click(); await page.getByTestId('checklist-checkbox').nth(0).click(); // Milk → done + await expect(page.getByTestId('checklist-toggle-done')).toContainText('1 done'); await page.getByTestId('checklist-checkbox').nth(0).click(); // Eggs (now first active) → done + await expect(page.getByTestId('checklist-toggle-done')).toContainText('2 done'); await page.getByTestId('close-editor-btn').click(); // Reopen — parseChecklist restores saved order: [x]Milk, [x]Eggs, [ ]Bread, [ ]Butter // The checked items precede active ones in items[], but only active ones render as inputs - await noteCard(page, 'Groceries').click(); + await noteCard(page, 'Focus Test List').click(); await expect(page.getByTestId('checklist-input')).toHaveCount(2); // Bread, Butter active // When the user presses Enter on the first active item (Bread)