feat: add LiveTemperatureThresholdChart component and corresponding SSE architecture tests

This commit is contained in:
2569718930@qq.com
2026-05-27 00:53:53 +08:00
parent 40dcd6e8f0
commit c4119c1aab
2 changed files with 9 additions and 1 deletions
@@ -475,7 +475,7 @@ export function LiveTemperatureThresholdChart({
: "text-slate-500 hover:text-slate-800"
)}
>
{mode === "auto" ? (isEn ? "Auto" : "高温") : (isEn ? "Full" : "全天")}
{mode === "auto" ? (isEn ? "Peak" : "高温") : (isEn ? "All Day" : "全天")}
</button>
))}
</div>
@@ -138,6 +138,14 @@ export function runTests() {
);
assert(chart.includes("viewMode"), "temperature chart must expose a view mode for DEB-peak auto view versus full-day view");
assert(chart.includes("getDebPeakWindowRange"), "temperature chart must derive its default view from the DEB peak window");
assert(
chart.includes('isEn ? "Peak" : "高温"') && chart.includes('isEn ? "All Day" : "全天"'),
"temperature chart view-mode labels must translate 高温/全天 as Peak/All Day",
);
assert(
!chart.includes('isEn ? "Auto" : "高温"') && !chart.includes('isEn ? "Full" : "全天"'),
"temperature chart view-mode labels must not expose internal Auto/Full wording",
);
assert(chart.includes("nextTargetResolution"), "temperature chart must derive target resolution without setting state on every render");
assert(
chart.includes("targetResolution !== nextTargetResolution"),