feat(platform): harden telemetry pipeline and unify Semi UI workspaces
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { VehicleRealtimeRow } from '../../api/types';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { formatNumber, statusLabel, vehicleStatus } from './monitor';
|
||||
import { formatNumber, normalizeMonitorBounds, statusLabel, vehicleStatus } from './monitor';
|
||||
|
||||
function vehicle(overrides: Partial<VehicleRealtimeRow> = {}): VehicleRealtimeRow {
|
||||
return {
|
||||
@@ -37,4 +37,11 @@ describe('monitor domain', () => {
|
||||
expect(formatNumber(12560)).toBe('12,560');
|
||||
expect(statusLabel('driving')).toBe('行驶');
|
||||
});
|
||||
|
||||
it('normalizes valid WGS-84 viewport bounds and drops unsafe map ranges', () => {
|
||||
expect(normalizeMonitorBounds('113,22,114,24')).toBe('113.000000,22.000000,114.000000,24.000000');
|
||||
expect(normalizeMonitorBounds('105,31,103,29')).toBe('');
|
||||
expect(normalizeMonitorBounds('-181,0,181,1')).toBe('');
|
||||
expect(normalizeMonitorBounds('113,22,Infinity,24')).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user