Cover active alert text rendering

This commit is contained in:
2026-06-12 14:08:19 +00:00
parent 12a7447494
commit 8d0bc90f9d
2 changed files with 128 additions and 1 deletions

View File

@@ -337,6 +337,22 @@ func TestMetricCopyAndNilHandling(t *testing.T) {
}
}
func TestAlertsPayloadPassThrough(t *testing.T) {
run := &model.WeatherAlertRun{
LocationID: "stl",
AsOf: time.Date(2026, 6, 11, 12, 0, 0, 0, time.UTC),
Alerts: []model.WeatherAlert{{
ID: "alert-1",
Headline: "Storm warning",
}},
}
payload := AlertsPayload(run, UnitsUS)
if payload != run {
t.Fatalf("expected alerts payload to pass through input run")
}
}
func TestCurrentConditionsPayloadMetricAndUS(t *testing.T) {
conditions := &app.CurrentConditions{
TemperatureC: float64Ptr(20),