feat(platform): add operations handoff summary
This commit is contained in:
@@ -40,6 +40,48 @@ test('exposes AMap operations shortcuts when map key is configured', async () =>
|
||||
})
|
||||
} as Response;
|
||||
}
|
||||
if (path.includes('/api/dashboard/summary')) {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: {
|
||||
onlineVehicles: 0,
|
||||
activeToday: 0,
|
||||
frameToday: 0,
|
||||
issueVehicles: 0,
|
||||
kafkaLag: 0,
|
||||
protocols: [],
|
||||
serviceStatuses: [],
|
||||
linkHealth: []
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
} as Response;
|
||||
}
|
||||
if (path.includes('/api/vehicle-service/summary')) {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: {
|
||||
totalVehicles: 0,
|
||||
boundVehicles: 0,
|
||||
onlineVehicles: 0,
|
||||
singleSourceVehicles: 0,
|
||||
multiSourceVehicles: 0,
|
||||
noDataVehicles: 0,
|
||||
identityRequiredVehicles: 0,
|
||||
archiveIncompleteVehicles: 0,
|
||||
serviceStatuses: [],
|
||||
protocols: [],
|
||||
missingSources: [],
|
||||
archiveMissingFields: []
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
} as Response;
|
||||
}
|
||||
if (path.includes('/api/mileage/summary')) {
|
||||
return {
|
||||
ok: true,
|
||||
@@ -1170,6 +1212,23 @@ test('dashboard copies highest priority quality issue notification text', async
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('详情:JT808 数据缺少 VIN 映射'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹证据:http://localhost:3000/#/history?keyword=%E7%B2%A4A%E5%91%8A%E8%AD%A61&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('RAW证据:http://localhost:3000/#/history-query?keyword=%E7%B2%A4A%E5%91%8A%E8%AD%A61&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: '复制运营交接摘要' }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【车辆数据中台运营交接摘要】'));
|
||||
});
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('在线车辆:88 / 1,033'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('今日活跃:96'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('今日帧量:1,286,320'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('Kafka Lag:0'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('最高告警:P0 VIN 缺失 / 粤A告警1 / 13307795425 / 2026-07-03 20:12:10'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('实时监控:http://localhost:3000/#/realtime?online=online'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('实时地图:http://localhost:3000/#/map?online=online'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹回放:http://localhost:3000/#/history?keyword=%E7%B2%A4A%E5%91%8A%E8%AD%A61&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史RAW:http://localhost:3000/#/history-query?keyword=%E7%B2%A4A%E5%91%8A%E8%AD%A61&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('告警事件:http://localhost:3000/#/alert-events?issueType=VIN_MISSING'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务:http://localhost:3000/#/detail?keyword=%E7%B2%A4A%E5%91%8A%E8%AD%A61&protocol=JT808'));
|
||||
});
|
||||
|
||||
test('dashboard keeps core vehicle service metrics when preview requests fail', async () => {
|
||||
|
||||
Reference in New Issue
Block a user