Commit db378bc
test(slots): make the empty-dates notice assertion clock-safe
Review catch on #23. The test asked for a window starting tomorrow with a
one-minute minimum notice and asserted that nothing was withheld. But
seedNoticeEventType opens availability at 00:00, so tomorrow's first slot is
midnight, and in the last minute of a UTC day the cutoff lands past it
(now 23:59:01 → cutoff 00:00:01). That slot is then correctly withheld, dates is
non-empty, and the test fails — roughly 59 seconds a day, for a reason unrelated
to what it is asserting.
Starts the window at +2 days instead. Every candidate slot is then at least 24
hours beyond any cutoff a one-minute policy can produce, whatever the clock says,
which is the property the file header promises for all of these.
Verified: TestGetSlots_minNoticeDatesEmptyWhenThePolicyCostThisRangeNothing and
TestGetSlots_minNoticeDatesUseTheRequestedTimezone both pass.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 8228988 commit db378bc
1 file changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
108 | 117 | | |
109 | 118 | | |
110 | 119 | | |
111 | 120 | | |
112 | | - | |
113 | | - | |
| 121 | + | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
| |||
0 commit comments