feat: show tasks completed today
ci / gitleaks (push) Successful in 7s
ci / docker (push) Successful in 5m38s

This commit is contained in:
2026-09-15 12:52:43 +08:00
parent d519843a9f
commit ebabb87780
10 changed files with 245 additions and 9 deletions
+9
View File
@@ -774,6 +774,15 @@ describe('task and habit row decoration', () => {
expect(mvpPanel).toContain("!showCompleted && habits.length ? '已完成的习惯已隐藏。'")
})
it('includes tasks actually completed today in Today even when they were overdue', () => {
expect(app).toContain('completed_at: string | null')
expect(app).toContain("const completedToday = task.completed_at && new Date(task.completed_at).toDateString() === now.toDateString()")
expect(app).toContain('return Boolean(dueToday || completedToday)')
expect(app).toContain("params.set('completed_from', isoAtLocalDayOffset(0))")
expect(app).toContain("params.set('completed_to', isoAtLocalDayOffset(1))")
expect(app).toContain("if (activeView.value === 'today' && showCompleted.value) await loadAll()")
})
it('reclassifies Today tasks after due edits without toggling page loading', () => {
const saveBlock = app.slice(app.indexOf('async function saveTask('), app.indexOf('async function removeTask'))
const refreshBlock = app.slice(app.indexOf('async function refreshTodayAfterTaskSave()'), app.indexOf('async function saveTask('))