From 950c99ef4bef0babe43921c13bfa758554eff08d Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Sat, 17 Jan 2026 15:53:27 +0100 Subject: [PATCH] test(e2e): fix flaky Pomodoro focus mode test Use keyboard shortcut ('d') to mark task as done instead of clicking the done button. This avoids element detachment issues caused by continuous re-renders from the progress bar while task is being tracked. Fixes timeout in "should keep overlay visible when last tracked task was completed" test. --- .../pomodoro-timer-sync-bug-5954.spec.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/e2e/tests/focus-mode/pomodoro-timer-sync-bug-5954.spec.ts b/e2e/tests/focus-mode/pomodoro-timer-sync-bug-5954.spec.ts index 00ca98d3a..d6a3294ab 100644 --- a/e2e/tests/focus-mode/pomodoro-timer-sync-bug-5954.spec.ts +++ b/e2e/tests/focus-mode/pomodoro-timer-sync-bug-5954.spec.ts @@ -341,17 +341,15 @@ test.describe('Bug #5954: Pomodoro timer sync issues', () => { // When isCurrent changes, the hover controls switch from play to pause button await waitForAngularStability(page); - // Step 2: Stop tracking first to avoid continuous re-renders from progress bar - // Use the task page's toggle method which handles play/pause button - await taskPage.toggleTaskTimeTracking(task); - await expect(task).not.toHaveClass(/isCurrent/, { timeout: 5000 }); - await waitForAngularStability(page); - - // Step 3: Mark task as done (now that tracking is stopped) - await taskPage.markTaskAsDone(task); + // Step 2: Mark task as done using keyboard shortcut + // This bypasses the button click issue caused by continuous re-renders + // from the progress bar while tracking is active + await task.focus(); + await page.keyboard.press('d'); // Keyboard shortcut for toggle done await expect(task).toHaveClass(/isDone/, { timeout: 5000 }); + await expect(task).not.toHaveClass(/isCurrent/, { timeout: 5000 }); - // Step 4: Open focus mode and try to start session + // Step 3: Open focus mode and try to start session await mainFocusButton.click(); await expect(focusModeOverlay).toBeVisible({ timeout: 5000 });