fix timers
lint / ruff (push) Failing after 15s
tests / desktop (push) Successful in 21s
tests / web (push) Successful in 46s
docker / image (push) Failing after 1m31s
tests / android-core (push) Successful in 1m5s
tests / backend (push) Successful in 2m33s
android / apk (push) Successful in 4m34s

This commit is contained in:
timka123 committed 2026-10-27 18:52:54 +03:00
1 parent ff77d8f89f
commit 157a113c39
30 files changed
+3331 -419

No files matched your search

+22
View File
@@ -29,6 +29,28 @@ def test_a_whole_pomodoro_through_the_api(client):
assert "Daily report" in report["telegram_preview"]
def test_a_stale_complete_leaves_the_auto_started_break_alone(client):
client.put(
"/api/settings",
json={"pomodoro": {"auto_start_breaks": True, "auto_start_work": True}},
)
state = client.post("/api/timer/start", json={"kind": "work"}).json()
work_id = state["current"]["id"]
done = client.post(
"/api/timer/complete", json={"auto_next": True, "session_id": work_id}
).json()
assert done["current"]["kind"] in ("short_break", "long_break")
break_id = done["current"]["id"]
# The other client's countdown, one beat behind.
again = client.post(
"/api/timer/complete", json={"auto_next": True, "session_id": work_id}
).json()
assert again["finished"] is None
assert again["current"]["id"] == break_id
def test_timer_errors_are_400_not_500(client):
assert client.post("/api/timer/pause").status_code == 400
assert client.post("/api/timer/complete", json={}).status_code == 400