Fix Ankara decision chart model coverage

This commit is contained in:
2569718930@qq.com
2026-05-17 19:12:28 +08:00
parent 8ade6dd7d2
commit a83200d505
4 changed files with 135 additions and 10 deletions
@@ -37,4 +37,40 @@ export function runTests() {
chartData?.datasets.debSeries.some((point) => point.labelTime === "10:00" && point.y === 24),
"temperature chart should keep normalized hourly temperatures on the curve",
);
const ankaraChartData = getTemperatureChartData(
{
name: "ankara",
display_name: "Ankara",
local_date: "2026-05-17",
local_time: "13:00",
temp_symbol: "°C",
current: {
temp: 18,
obs_time: "2026-05-17T10:50:00Z",
settlement_source: "mgm",
},
forecast: { today_high: null },
deb: { prediction: 24 },
mgm: {
hourly: [
{ time: "11:00", temp: 19 },
{ time: "12:00", temp: 21 },
{ time: "13:00", temp: 22 },
{ time: "14:00", temp: 23 },
],
},
metar_today_obs: [{ time: "13:00", temp: 22 }],
} as unknown as CityDetail,
"zh-CN",
);
assert(
ankaraChartData?.datasets.debSeries.some((point) => point.labelTime === "13:00"),
"Ankara chart should build the DEB original path from MGM hourly data when Open-Meteo hourly is unavailable",
);
assert(
ankaraChartData?.datasets.calibratedFutureSeries.length,
"Ankara chart should still expose a calibrated path when observation points exist",
);
}