Throttle chart stale retry badges
This commit is contained in:
@@ -69,8 +69,9 @@ export async function runTests() {
|
||||
assert(
|
||||
chartSource.includes("useLatestPatch") &&
|
||||
chartSource.includes("latestPatch") &&
|
||||
chartSource.includes("2 * 60_000"),
|
||||
"selected city chart should consume SSE patches and use a 2-minute no-patch fallback",
|
||||
chartSource.includes("DASHBOARD_REFRESH_POLICY_MS.metar") &&
|
||||
!chartSource.includes("2 * 60_000"),
|
||||
"selected city chart should consume SSE patches and use a METAR-cadence no-patch fallback instead of a 2-minute forced refresh",
|
||||
);
|
||||
assert(
|
||||
chartSource.includes("preloadTemperatureChartCanvas"),
|
||||
@@ -184,6 +185,12 @@ export async function runTests() {
|
||||
chartCanvasSourceIncludes(chartSource, "handleRetryDetail"),
|
||||
"city detail charts should show stale cache first and expose a retryable unavailable state",
|
||||
);
|
||||
assert(
|
||||
chartSource.includes("const showDetailErrorBadge = !compact || isActive || isMaximized") &&
|
||||
chartSource.includes("showDetailErrorBadge={showDetailErrorBadge}") &&
|
||||
chartCanvasSourceIncludes(chartSource, "showDetailErrorBadge"),
|
||||
"compact grid charts should only show the stale-cache retry badge on the active slot or expanded chart",
|
||||
);
|
||||
assert(
|
||||
__shouldFetchCityDetailForChartForTest({ city: "paris", documentHidden: false, isChartVisible: true }) === true,
|
||||
"visible chart cards should fetch city detail",
|
||||
|
||||
Reference in New Issue
Block a user