Correct expected date in tests
This commit is contained in:
parent
90dba7b399
commit
ece729610f
1 changed files with 6 additions and 2 deletions
|
@ -110,7 +110,7 @@ func TestScheduleNextDueDateBasic(t *testing.T) {
|
||||||
IsRolling: false,
|
IsRolling: false,
|
||||||
},
|
},
|
||||||
completedAt: choreTime,
|
completedAt: choreTime,
|
||||||
expected: choreTime.AddDate(0, 0, 14).UTC().Truncate(time.Hour).Add(30 * time.Minute), // Same Minute as Metadata time?
|
expected: truncateToDay(choreTime.AddDate(0, 0, 14).UTC()).Add(18 * time.Hour).Add(30 * time.Minute), // Note: Same Hour and Minute as Metadata time
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "14 days interval Completed late",
|
Name: "14 days interval Completed late",
|
||||||
|
@ -122,7 +122,7 @@ func TestScheduleNextDueDateBasic(t *testing.T) {
|
||||||
IsRolling: false,
|
IsRolling: false,
|
||||||
},
|
},
|
||||||
completedAt: choreTime.AddDate(0, 0, 1),
|
completedAt: choreTime.AddDate(0, 0, 1),
|
||||||
expected: choreTime.AddDate(0, 0, 14).UTC().Truncate(time.Hour).Add(30 * time.Minute), // Same Minute as Metadata time?
|
expected: truncateToDay(choreTime.AddDate(0, 0, 14).UTC()).Add(18 * time.Hour).Add(30 * time.Minute), // Note: Same Hour and Minute as Metadata time
|
||||||
},
|
},
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -144,6 +144,10 @@ func TestScheduleNextDueDateBasic(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func truncateToDay(t time.Time) time.Time {
|
||||||
|
return time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location())
|
||||||
|
}
|
||||||
|
|
||||||
func TestScheduleNextDueDateDayOfTheWeek(t *testing.T) {
|
func TestScheduleNextDueDateDayOfTheWeek(t *testing.T) {
|
||||||
choreTime := time.Now()
|
choreTime := time.Now()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue