fix(platform): harden queries and batch vehicle search
This commit is contained in:
@@ -91,6 +91,20 @@ 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('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();
|
||||
const params = new URLSearchParams({ keyword: 'VIN001' });
|
||||
|
||||
await api.trackPlayback(params, controller.signal);
|
||||
await api.historyData(params, controller.signal);
|
||||
await api.historySeries(params, controller.signal);
|
||||
await api.dailyMileage(params, controller.signal);
|
||||
await api.mileageStatistics(params, controller.signal);
|
||||
|
||||
for (const [, init] of fetchMock.mock.calls) expect(init).toEqual({ signal: controller.signal });
|
||||
});
|
||||
|
||||
test('rawFramesQuery posts structured JSON instead of URL query strings', async () => {
|
||||
const fetchMock = vi.spyOn(globalThis, 'fetch').mockResolvedValue({
|
||||
ok: true,
|
||||
|
||||
Reference in New Issue
Block a user