mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Add notes to DelayedToggle, make delay skipable
This commit is contained in:
@@ -123,8 +123,7 @@ open class ListHabitsBehavior @Inject constructor(
|
||||
if (prefs.isFirstRun) onFirstRun()
|
||||
}
|
||||
|
||||
fun onToggle(habit: Habit, timestamp: Timestamp?, value: Int) {
|
||||
val notes = habit.computedEntries.get(timestamp!!).notes
|
||||
fun onToggle(habit: Habit, timestamp: Timestamp, value: Int, notes: String) {
|
||||
commandRunner.run(
|
||||
CreateRepetitionCommand(habitList, habit, timestamp, value, notes)
|
||||
)
|
||||
|
||||
@@ -168,7 +168,12 @@ class ListHabitsBehaviorTest : BaseUnitTest() {
|
||||
@Test
|
||||
fun testOnToggle() {
|
||||
assertTrue(habit1.isCompletedToday())
|
||||
behavior.onToggle(habit1, getToday(), Entry.NO)
|
||||
behavior.onToggle(
|
||||
habit = habit1,
|
||||
timestamp = getToday(),
|
||||
value = Entry.NO,
|
||||
notes = ""
|
||||
)
|
||||
assertFalse(habit1.isCompletedToday())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user