package calendartest import ( "net/http" "net/url" "regexp" "strings" "testing" "time" calendar "amadan.net/oficina/calendar/internal/calendar" ) // createEvent posts the real form and returns the new event's path. func createEvent(t *testing.T, h http.Handler, session *http.Cookie, form url.Values) string { t.Helper() // Read the SELECTED option, not the first one — that is what a // browser submits when nobody touches the dropdown, and it is the // personal calendar rather than the shared team one. An earlier // version of this helper took the first option, silently created // every test event on the team calendar, and made the isolation // test look like an app bug. if form.Get("calendar_id") == "" { page := getAs(t, h, session, "/events/new").Body.String() m := regexp.MustCompile(`