fix(web): harden route transitions and monitor memory

This commit is contained in:
lingniu
2026-07-15 23:54:21 +08:00
parent 3fabcf181a
commit c29ccdf2da
17 changed files with 332 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { MAX_MONITOR_SEARCH_TERMS, MONITOR_REFRESH, monitorMapQueryParams, monitorQueryParams, parseMonitorSearchTerms } from './useMonitorData';
import { MAX_MONITOR_SEARCH_TERMS, MONITOR_CACHE, MONITOR_REFRESH, monitorMapQueryParams, monitorQueryParams, parseMonitorSearchTerms } from './useMonitorData';
describe('monitor query params', () => {
it('keeps server-owned status filters and bounded list size', () => {
@@ -36,4 +36,8 @@ describe('monitor refresh cadence', () => {
expect(MONITOR_REFRESH.selected).toBeLessThan(MONITOR_REFRESH.fleet);
expect(MONITOR_REFRESH.fleet).toBeLessThan(MONITOR_REFRESH.summary);
});
it('does not retain inactive viewport payloads in the query cache', () => {
expect(MONITOR_CACHE.mapGcTime).toBe(0);
});
});