Support species height and width ranges
CI / test (push) Failing after 3m6s

This commit is contained in:
2026-09-16 20:21:41 +02:00
parent 87809b2344
commit ef608551ad
14 changed files with 271 additions and 69 deletions
+10 -2
View File
@@ -371,11 +371,19 @@ func TestEmptyOptionalSpeciesDimensionsDoNotBlockSubmit(t *testing.T) {
response := httptest.NewRecorder()
app.render(response, http.StatusOK, "species_form.tmpl", data)
body := response.Body.String()
for _, field := range []string{"spacing_cm", "height_cm"} {
if !strings.Contains(body, "name='"+field+"' value=''") {
for _, field := range []string{"spacing_cm", "height_cm_from", "height_cm_to", "width_cm_from", "width_cm_to"} {
fieldStart := strings.Index(body, "name='"+field+"'")
fieldEnd := -1
if fieldStart >= 0 {
fieldEnd = strings.Index(body[fieldStart:], ">")
}
if fieldStart < 0 || fieldEnd < 0 || !strings.Contains(body[fieldStart:fieldStart+fieldEnd], "value=''") {
t.Errorf("optional field %s should render empty: %s", field, body)
}
}
if got := strings.Count(body, "class='dimension-range'"); got != 2 {
t.Errorf("dimension ranges: got %d composite controls, want 2: %s", got, body)
}
}
func TestTaskDueFormatsWindows(t *testing.T) {