Update the hourly report template to trim excess whitespace when alert and/or preciptiation sections are omitted

This commit is contained in:
2026-06-16 20:44:28 -05:00
parent 482e83903c
commit b57110e5c8
2 changed files with 20 additions and 12 deletions

View File

@@ -730,6 +730,17 @@ func TestRenderHourlyOmitsConditionalSectionsForClearWeather(t *testing.T) {
t.Fatalf("clear render includes %q:\n%s", unwanted, text)
}
}
if strings.Contains(text, "\n\n\n") {
t.Fatalf("clear render includes excess blank lines:\n%s", text)
}
for _, want := range []string{
"Currently, it is 72°F and cloudy.\n\n## Hourly Forecast",
"- **9:00 AM:** 71°F and mostly cloudy.\n\n## Forecast Discussion",
} {
if !strings.Contains(text, want) {
t.Fatalf("clear render missing spacing %q:\n%s", want, text)
}
}
}
func TestRenderHourlyUsesSharedOpenEndedPrecipitationTiming(t *testing.T) {