diff --git a/client/e2e/timer.spec.ts b/client/e2e/timer.spec.ts index e7b161f..8031390 100644 --- a/client/e2e/timer.spec.ts +++ b/client/e2e/timer.spec.ts @@ -32,6 +32,20 @@ test("start → pause → resume → discard flow", async ({ page }) => { await expect(page.getByTestId("timer-select-project-dialog")).not.toBeVisible(); }); +test("stopping and selecting a project saves the timer", async ({ page }) => { + await page.getByTestId("timer-start").click(); + await page.getByTestId("timer-pause").click(); + await page.getByTestId("timer-stop").click(); + + const dialog = page.getByTestId("timer-select-project-dialog"); + await expect(dialog).toBeVisible(); + + await dialog.locator("form button").first().click(); + + await expect(page.getByTestId("timer-start")).toBeVisible(); + await expect(dialog).not.toBeVisible(); +}); + test("start → pause → resume flow", async ({ page }) => { await page.getByTestId("timer-start").click(); await expect(page.getByTestId("timer-pause")).toBeVisible(); diff --git a/client/src/routes/_app/timer.tsx b/client/src/routes/_app/timer.tsx index 1c9db56..fcabda3 100644 --- a/client/src/routes/_app/timer.tsx +++ b/client/src/routes/_app/timer.tsx @@ -64,7 +64,10 @@ function EntryRow(properties: { }; return ( -