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

@@ -0,0 +1,11 @@
import { describe, expect, it } from 'vitest';
import { routeSectionForPath } from './routeModules';
describe('route module preloading', () => {
it('maps nested and parameterized URLs to the correct lazy module', () => {
expect(routeSectionForPath('/monitor')).toBe('monitor');
expect(routeSectionForPath('/vehicles/LTEST001?tab=telemetry')).toBe('vehicles');
expect(routeSectionForPath('/alerts/rules#editor')).toBe('alerts');
expect(routeSectionForPath('/not-a-platform-route')).toBeUndefined();
});
});