feat(platform): expose missing source diagnosis

This commit is contained in:
lingniu
2026-07-04 06:00:06 +08:00
parent bf17c7437e
commit a60f87c9e7
8 changed files with 102 additions and 22 deletions

View File

@@ -2607,13 +2607,14 @@ test('shows cross-source consistency for one vehicle service', async () => {
sourceCount: 3,
onlineSourceCount: 2,
locatedSourceCount: 3,
missingProtocols: ['YUTONG_MQTT'],
mileageDeltaKm: 0.4,
sourceTimeDeltaSeconds: 35,
scope: 'all_sources',
status: 'degraded',
severity: 'warning',
title: '部分来源离线',
detail: '2/3 个来源在线,车辆服务可用但需要关注离线来源。'
title: '来源不完整',
detail: '2/3 个来源在线,车辆服务可用但缺少 YUTONG_MQTT 来源。'
},
sources: ['GB32960', 'JT808', 'YUTONG_MQTT'],
sourceStatus: [
@@ -2651,10 +2652,11 @@ test('shows cross-source consistency for one vehicle service', async () => {
render(<App />);
expect(await screen.findByText('跨来源一致性')).toBeInTheDocument();
expect(screen.getAllByText('部分来源离线').length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText('2/3 个来源在线,车辆服务可用但需要关注离线来源。').length).toBeGreaterThan(0);
expect(screen.getAllByText('来源不完整').length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText('2/3 个来源在线,车辆服务可用但缺少 YUTONG_MQTT 来源。').length).toBeGreaterThan(0);
expect(screen.getByText('3 个来源')).toBeInTheDocument();
expect(screen.getByText('2/3 在线')).toBeInTheDocument();
expect(screen.getByText('缺失来源')).toBeInTheDocument();
expect(screen.getAllByText('3 个来源有位置').length).toBeGreaterThan(0);
expect(screen.getAllByText('0.4 km').length).toBeGreaterThan(0);
expect(screen.getAllByText('35 秒').length).toBeGreaterThan(0);