feat(platform): expose source consistency

This commit is contained in:
lingniu
2026-07-04 04:01:33 +08:00
parent 353b71ebbb
commit db70f58a7c
6 changed files with 195 additions and 37 deletions

View File

@@ -1762,6 +1762,14 @@ test('shows cross-source consistency for one vehicle service', async () => {
totalMileageKm: 1000.5,
lastSeen: '2026-07-03T20:12:10+08:00'
},
sourceConsistency: {
sourceCount: 3,
onlineSourceCount: 2,
locatedSourceCount: 3,
mileageDeltaKm: 0.4,
sourceTimeDeltaSeconds: 35,
scope: 'all_sources'
},
sources: ['GB32960', 'JT808', 'YUTONG_MQTT'],
sourceStatus: [
{ protocol: 'GB32960', online: true, lastSeen: '2026-07-03T20:12:10+08:00', hasRealtime: true, hasHistory: true, hasRaw: true, hasMileage: true },
@@ -1801,6 +1809,6 @@ test('shows cross-source consistency for one vehicle service', async () => {
expect(screen.getByText('3 个来源')).toBeInTheDocument();
expect(screen.getByText('2/3 在线')).toBeInTheDocument();
expect(screen.getByText('3 个来源有位置')).toBeInTheDocument();
expect(screen.getByText('0.3 km')).toBeInTheDocument();
expect(screen.getByText('30 秒')).toBeInTheDocument();
expect(screen.getByText('0.4 km')).toBeInTheDocument();
expect(screen.getByText('35 秒')).toBeInTheDocument();
});