Update the hourly report template to trim excess whitespace when alert and/or preciptiation sections are omitted
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user