feat: add visible habit check controls
ci / docker (push) Successful in 4m15s

This commit is contained in:
2026-09-07 15:55:55 +08:00
parent 46b389f3af
commit 3827e14a83
3 changed files with 24 additions and 7 deletions
+13
View File
@@ -72,6 +72,19 @@ describe('task and habit row decoration', () => {
expect(css).toContain('.task-check:focus-visible{')
})
it('shows the same visible round check control for boolean and numeric habits in both views', () => {
expect(mvpPanel).not.toContain('class="sr-only" :aria-label="isDone(h, todayKey)')
expect(mvpPanel.match(/class="task-check habit-check"/g)?.length).toBe(2)
expect(mvpPanel.match(/class="task-check-mark"/g)?.length).toBe(2)
expect(mvpPanel.match(/<Check v-if="isDone\(h, todayKey\)"/g)?.length).toBe(2)
expect(css).toContain('.habit-check{')
expect(mvpPanel).toContain('@pointerdown="startHabitPointer')
const toggleBlock = mvpPanel.slice(mvpPanel.indexOf('async function toggleHabitFromButton'), mvpPanel.indexOf('async function addHabit'))
expect(toggleBlock).toContain('setLocalHabitValue(h, next)')
expect(toggleBlock).toContain('setLocalHabitValue(h, previous)')
expect(toggleBlock).not.toContain('await loadHabits()')
})
it('does not draw a left border on task or habit rows', () => {
expect(css).toContain('.task-row{border-left:0;')
expect(css).toContain('.habit-row{border-left:0;')