diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-09-08 15:53:07 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-09-08 15:53:07 +0200 |
| commit | 6d69c7b1e6a8051338e052cc9d1836f4f1a20f51 (patch) | |
| tree | 33af9e78d93afe34f113aad116d3e5e4ed2a5fc1 /src/lib/server/services | |
| parent | 212c3adc8a584e6517a2816fc6683688d5ac5d7a (diff) | |
Late only after a full missed period
Status buckets shift a full period out: due until an occurrence is
skipped entirely, late after one, very late after two. Health decay
halves (100 - ratio*50) so 50 marks late and 0 marks veryLate.
Diffstat (limited to 'src/lib/server/services')
| -rw-r--r-- | src/lib/server/services/routines.test.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/server/services/routines.test.ts b/src/lib/server/services/routines.test.ts index 04151c2..22b49ff 100644 --- a/src/lib/server/services/routines.test.ts +++ b/src/lib/server/services/routines.test.ts @@ -134,9 +134,8 @@ describe('routines service', () => { const r = await add(projectId, 'clean kitchen', 7, db); const createdAt = Date.parse(r.createdAt); await complete(r.id, null, new Date(createdAt).toISOString(), db); - - // 15 days after completion with a 7-day routine => very late - const now = createdAt + 15 * DAY_MS; + // 22 days after completion with a 7-day routine => two periods overdue + const now = createdAt + 22 * DAY_MS; const dashboard = await loadProjectDashboard(projectId, now, db); expect(dashboard.routines).toHaveLength(1); expect(dashboard.routines[0].status).toBe('veryLate'); |
