Refresh terminal charts on activation

This commit is contained in:
2569718930@qq.com
2026-06-14 08:08:49 +08:00
parent ad1e203adf
commit e2ebf5132d
7 changed files with 123 additions and 11 deletions
@@ -249,11 +249,12 @@ export function runTests() {
);
const foregroundRefreshBlock = chart.match(/const refreshForegroundFullDetail = \(\) => \{[\s\S]*?\n \};/)?.[0] || "";
assert(
foregroundRefreshBlock.includes("ignoreCache: true") &&
foregroundRefreshBlock.includes("fetchHourlyForecastForCity") &&
foregroundRefreshBlock.includes("FOREGROUND_FULL_DETAIL_REFRESH_DEDUP_MS") &&
!foregroundRefreshBlock.includes("setIsHourlyLoading(true)"),
"foreground resume refresh should update full detail in the background without showing the loading overlay or refetching fresh detail",
foregroundRefreshBlock.includes("bypassLocalCache: true") &&
foregroundRefreshBlock.includes("fetchHourlyForecastForCity") &&
foregroundRefreshBlock.includes("FOREGROUND_FULL_DETAIL_REFRESH_DEDUP_MS") &&
!foregroundRefreshBlock.includes("ignoreCache: true") &&
!foregroundRefreshBlock.includes("setIsHourlyLoading(true)"),
"foreground resume refresh should revalidate cached detail in the background without showing the loading overlay or forcing external sources",
);
assert(
!chart.includes("/api/city/${encodeURIComponent(city)}/summary"),