mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
ensure we provide a future date in MSRC test (#8897)
This test was failing in Dec 2022, because in this line: ```go _, err := sut.GetFeed((now.AddDate(0, 1, 0)).Month(), now.Year()) ``` `(now.AddDate(0, 1, 0)).Month()` returns `"January"` , and `now.Year()` returns `2022` , so we were sending a date in the past.
This commit is contained in:
parent
44609419b2
commit
837fef4bc4
1 changed files with 11 additions and 3 deletions
|
|
@ -31,9 +31,17 @@ func TestMSRCClient(t *testing.T) {
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("provided month and year is in the future", func(t *testing.T) {
|
t.Run("provided arguments are in the future", func(t *testing.T) {
|
||||||
_, err := sut.GetFeed((now.AddDate(0, 1, 0)).Month(), now.Year())
|
cases := []time.Time{
|
||||||
require.Error(t, err)
|
now.AddDate(0, 1, 0),
|
||||||
|
now.AddDate(1, 0, 0),
|
||||||
|
now.AddDate(1, 1, 0),
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, c := range cases {
|
||||||
|
_, err := sut.GetFeed(c.Month(), c.Year())
|
||||||
|
require.Error(t, err)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue