feat: show tasks completed today
This commit is contained in:
@@ -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('))
|
||||
|
||||
Reference in New Issue
Block a user