Validate precipitation probabilities and ice wording
This commit is contained in:
@@ -127,6 +127,21 @@ func TestBuildDerivedDailyIncludesNextDayOvernightAlerts(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildDerivedRejectsInvalidPrecipitationProbability(t *testing.T) {
|
||||
location := testLocation()
|
||||
bundle := testBundle(location)
|
||||
invalid := -1.0
|
||||
bundle.Hourly.Periods[0].ProbabilityOfPrecipitationPercent = &invalid
|
||||
_, err := BuildDerived(BuildDerivedRequest{
|
||||
Resolved: resolveForTest(t, report.Hourly, mustParse("2026-05-29T08:00:00-05:00"), location),
|
||||
Timezone: location.String(),
|
||||
Collected: BuildCollected(bundle),
|
||||
})
|
||||
if err == nil || !strings.Contains(err.Error(), "invalid precipitation probability") {
|
||||
t.Fatalf("BuildDerived() error = %v, want invalid precipitation probability", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildDerivedTomorrow(t *testing.T) {
|
||||
location := testLocation()
|
||||
for _, id := range []report.ID{report.Tomorrow} {
|
||||
|
||||
Reference in New Issue
Block a user