oficina / calendar Public

Keep deferred mail test independent of remaining day slots

Paul Campbell pushed by paul@keymail.dev 10d642262c3ea4c5cc6dd73e6ccbea5b47e781dc parent c63b4dc
1 file changed, +10 −1
  • internal/calendartest/booking_review2_test.go +10 −1

CI passed — run details

diff --git a/internal/calendartest/booking_review2_test.go b/internal/calendartest/booking_review2_test.go
index dd5d957..09fb0bf 100644
--- a/internal/calendartest/booking_review2_test.go
+++ b/internal/calendartest/booking_review2_test.go
@@ -166,7 +166,16 @@ func TestADeferredHoldMailIsNotReportedSent(t *testing.T) {
"availability": {"every day 0-24"}, "duration_min": {"30"}, "buffer_min": {"0"}, "notice_min": {"0"}, "horizon_days": {"30"}})
postAs(t, h, session, "/settings/booking/1/publish", url.Values{"publish": {"1"}})
path := strings.TrimSpace(rePublicURL.FindString(getAs(t, h, session, "/settings/booking").Body.String()))
- _, starts := firstDaySlots(t, h, path)
+ // Use a full future day: today's remaining slots depend on the test hour.
+ day := time.Now().UTC().AddDate(0, 0, 2).Format("2006-01-02")
+ response := strangerGet(t, h, path+"?day="+day+"&zone=UTC")
+ if response.Code != http.StatusOK {
+ t.Fatalf("future day status=%d", response.Code)
+ }
+ var starts []string
+ for _, match := range reStart.FindAllStringSubmatch(response.Body.String(), -1) {
+ starts = append(starts, match[1])
+ }
if len(starts) < 5 {
t.Fatalf("only %d slots on the first day", len(starts))
}