Update the today report template

This commit is contained in:
2026-06-15 11:01:03 -05:00
parent 63dfc0b55a
commit 58fe794227
4 changed files with 41 additions and 451 deletions

View File

@@ -203,14 +203,12 @@ func TestBuildTodayRenderContext(t *testing.T) {
"# Today's Weather",
"**Forecast date:** Monday, June 15, 2026",
"Today starts quiet, then showers become more likely later in the day.",
"Currently, it is 58°F and clear.",
"Currently, it is 58°F and clear. It feels like 57°F, with a relative humidity of 61% and winds from the northwest at 9 mph.",
"- **Morning:** Partly cloudy, with temperatures in the low 60s.",
"- **Afternoon:** Showers, with temperatures in the mid 70s. Chance of precipitation is 70%.",
"## Precipitation Timing",
"- **3:00 PM** to **6:00 PM**: Precipitation is expected during this period. The peak precipitation chance is 70% at 3:00 PM.",
"The most likely rain window is from midafternoon into early evening.",
"## Planning Notes",
"- Take sunglasses early.",
"Morning conditions should stay mostly dry.",
"Rain chances increase during the afternoon as deeper moisture arrives.",
} {
@@ -225,9 +223,11 @@ func TestBuildTodayRenderContext(t *testing.T) {
"- **Morning:**",
"- **Afternoon:**",
"## Precipitation Timing",
"## Planning Notes",
"## Forecast Discussion",
})
if strings.Contains(text, "## Planning Notes") || strings.Contains(text, "- Take sunglasses early.") || strings.Contains(text, "Forecast details are limited") {
t.Fatalf("rendered template included removed Today template content:\n%s", text)
}
}
func TestBuildTodayRenderContextAllowsOmittedOptionalModules(t *testing.T) {
@@ -250,7 +250,7 @@ func TestBuildTodayRenderContextAllowsOmittedOptionalModules(t *testing.T) {
t.Fatalf("Render() error = %v", err)
}
text := string(rendered)
for _, unwanted := range []string{"## Current Conditions", "## Precipitation Timing", "## Planning Notes"} {
for _, unwanted := range []string{"## Current Conditions", "## Precipitation Timing", "## Planning Notes", "Forecast details are limited"} {
if strings.Contains(text, unwanted) {
t.Fatalf("rendered template included %q without module data:\n%s", unwanted, text)
}
@@ -493,8 +493,12 @@ func testTodaySnapshot(t *testing.T) module.Snapshot {
ID: module.CurrentConditions,
StanzaName: string(module.CurrentConditions),
Value: briefing.CurrentConditionsModule{
ConditionTextLower: "clear",
TemperatureF: intPtr(58),
ConditionTextLower: "clear",
TemperatureF: intPtr(58),
ApparentTemperatureF: intPtr(57),
RelativeHumidityPercent: intPtr(61),
WindSpeedMph: intPtr(9),
WindDirectionText: "northwest",
},
},
{