From 6d69c7b1e6a8051338e052cc9d1836f4f1a20f51 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 8 Sep 2026 15:53:07 +0200 Subject: 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. --- src/lib/server/services/routines.test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/lib/server/services') 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'); -- cgit v1.3