Fix WU historical current observation merge

This commit is contained in:
2569718930@qq.com
2026-05-29 17:20:07 +08:00
parent 8f52b1d80c
commit 9e3a4e2f45
13 changed files with 859 additions and 9 deletions
@@ -5,6 +5,7 @@ import {
__getLiveObservationLabelsForTest,
__getObservationDisplayMetricsForTest,
__getPeakGlowStateForTest,
__getWundergroundDailyHighForTest,
__getVisibleTemperatureSeriesForTest,
__isTemperatureSeriesVisibleByDefaultForTest,
__mergePatchIntoHourlyForTest,
@@ -102,6 +103,22 @@ export function runTests() {
"morning observations near the intraday observed high should not trigger peak glow before the forecast hot window",
);
assert(
__getWundergroundDailyHighForTest({
wundergroundCurrent: { max_so_far: 26 },
airportCurrent: { max_so_far: 27 },
airportPrimary: { max_so_far: 27 },
} as any) === 26,
"WU display should use Wunderground historical.json high before airport/METAR highs",
);
assert(
__getWundergroundDailyHighForTest({
airportCurrent: { max_so_far: 27 },
airportPrimary: { max_so_far: 27 },
} as any) === null,
"WU display should not fall back to airport/METAR highs when historical.json is missing",
);
const guangzhou = {
city: "guangzhou",
local_date: "2026-05-25",