This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { calendarModeLabel, clampFabPosition, countdownDayText, countdownKindLabel, dateKey, defaultView, habitWeek, isFabDrag, isHabitComplete, isHabitScheduledToday, isTaskView, nextHabitSwipeValue, numericHabitInputValue, previousHabitSwipeValue, quickTaskFields, shouldToggleRowSwipe } from './mvp-utils'
|
||||
import { calendarModeLabel, clampFabPosition, countdownDayText, countdownKindLabel, dateKey, defaultView, habitButtonValue, habitWeek, isFabDrag, isHabitComplete, isHabitScheduledToday, isTaskView, nextHabitSwipeValue, numericHabitInputValue, previousHabitSwipeValue, quickTaskFields, shouldToggleRowSwipe } from './mvp-utils'
|
||||
|
||||
describe('MVP view utilities', () => {
|
||||
it('formats a local date as YYYY-MM-DD', () => {
|
||||
@@ -63,6 +63,13 @@ describe('MVP view utilities', () => {
|
||||
expect(previousHabitSwipeValue('numeric', 0)).toBe(0)
|
||||
})
|
||||
|
||||
it('resets a completed numeric habit when its round button is clicked again', () => {
|
||||
expect(habitButtonValue('numeric', 2, 3)).toBe(3)
|
||||
expect(habitButtonValue('numeric', 3, 3)).toBe(0)
|
||||
expect(habitButtonValue('boolean', 0, 1)).toBe(1)
|
||||
expect(habitButtonValue('boolean', 1, 1)).toBe(0)
|
||||
})
|
||||
|
||||
it('renders countdown labels from date-only day values', () => {
|
||||
expect(countdownDayText(8)).toBe('还有 8 天')
|
||||
expect(countdownDayText(0)).toBe('就是今天')
|
||||
|
||||
Reference in New Issue
Block a user