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.
This commit is contained in:
Johannes Millan 2026-01-17 15:53:27 +01:00
parent 0a7e0c317e
commit 950c99ef4b

View file

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