perf(monitor): aggregate realtime workspace
This commit is contained in:
@@ -91,6 +91,13 @@ test('monitor viewport requests forward AbortSignal so obsolete pans can be canc
|
||||
expect(fetchMock).toHaveBeenCalledWith('/api/v2/monitor/map?zoom=13&bounds=113%2C22%2C114%2C23', { signal: controller.signal });
|
||||
});
|
||||
|
||||
test('monitor workspace aggregates the map screen behind one abortable request', async () => {
|
||||
const fetchMock = vi.spyOn(globalThis, 'fetch').mockResolvedValue({ ok: true, json: async () => ({ data: { summary: {}, vehicles: { items: [] }, map: { points: [], clusters: [] } } }) } as Response);
|
||||
const controller = new AbortController();
|
||||
await api.monitorWorkspace(new URLSearchParams({ zoom: '13', railLimit: '200' }), controller.signal);
|
||||
expect(fetchMock).toHaveBeenCalledWith('/api/v2/monitor/workspace?zoom=13&railLimit=200', { signal: controller.signal });
|
||||
});
|
||||
|
||||
test('high-volume history, track, and mileage requests forward AbortSignal', async () => {
|
||||
const fetchMock = vi.spyOn(globalThis, 'fetch').mockResolvedValue({ ok: true, json: async () => ({ data: {} }) } as Response);
|
||||
const controller = new AbortController();
|
||||
|
||||
Reference in New Issue
Block a user