feat: swipe complete, list archive, today habits and calendar subscriptions
ci / docker (push) Successful in 3m20s

This commit is contained in:
2026-09-06 09:33:37 +08:00
parent 13715945d5
commit b937c8ca72
15 changed files with 474 additions and 57 deletions
+6 -6
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
import { dateKey, habitWeek, isHabitComplete, isTaskView, numericHabitInputValue, shouldToggleHabitSwipe } from './mvp-utils'
import { dateKey, habitWeek, isHabitComplete, isTaskView, numericHabitInputValue, shouldToggleRowSwipe } from './mvp-utils'
describe('MVP view utilities', () => {
it('formats a local date as YYYY-MM-DD', () => {
@@ -29,10 +29,10 @@ describe('MVP view utilities', () => {
expect(numericHabitInputValue(4)).toBe(4)
})
it('toggles a habit only for a deliberate horizontal swipe', () => {
expect(shouldToggleHabitSwipe(78, 8)).toBe(true)
expect(shouldToggleHabitSwipe(-78, 8)).toBe(false)
expect(shouldToggleHabitSwipe(30, 2)).toBe(false)
expect(shouldToggleHabitSwipe(80, 35)).toBe(false)
it('toggles a row only for a deliberate right swipe', () => {
expect(shouldToggleRowSwipe(78, 8)).toBe(true)
expect(shouldToggleRowSwipe(-78, 8)).toBe(false)
expect(shouldToggleRowSwipe(30, 2)).toBe(false)
expect(shouldToggleRowSwipe(80, 35)).toBe(false)
})
})