feat(platform): add history evidence package
This commit is contained in:
@@ -4651,7 +4651,25 @@ test('copies trajectory playback summary from history page', async () => {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: { items: [], total: 0, limit: 10, offset: 0 },
|
||||
data: {
|
||||
items: [{
|
||||
id: 'raw-history-evidence-001',
|
||||
vin: 'VIN-HISTORY-SUMMARY',
|
||||
plate: '粤A轨迹1',
|
||||
protocol: 'JT808',
|
||||
frameType: '0x0200',
|
||||
rawSizeBytes: 96,
|
||||
deviceTime: '2026-07-03 10:00:00',
|
||||
serverTime: '2026-07-03 10:00:02',
|
||||
parsedFields: {
|
||||
'jt808.location.longitude': 113.201,
|
||||
'jt808.location.total_mileage_km': 1000
|
||||
}
|
||||
}],
|
||||
total: 1,
|
||||
limit: 10,
|
||||
offset: 0
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
@@ -4681,6 +4699,20 @@ test('copies trajectory playback summary from history page', async () => {
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('最高速度:58.8 km/h'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('起点:2026-07-03 10:00:00'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('终点:2026-07-03 11:00:00'));
|
||||
|
||||
fireEvent.click(screen.getAllByRole('button', { name: /复制历史证据包/ })[0]);
|
||||
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【历史证据包】'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆:VIN-HISTORY-SUMMARY'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('位置记录:2,有效定位:2'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('RAW帧:1,解析字段:2'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('异常:断点 1 / 里程回退 0 / 超速 0'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹回放:http://localhost:3000/#/history?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史位置:http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=location&dateFrom=2026-07-03&dateTo=2026-07-04'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('RAW证据:http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=raw&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('解析字段:http://localhost:3000/#/history-query?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&tab=fields&dateFrom=2026-07-03&dateTo=2026-07-04&includeFields=true'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('里程复核:http://localhost:3000/#/mileage?keyword=VIN-HISTORY-SUMMARY&protocol=JT808&dateFrom=2026-07-03&dateTo=2026-07-04'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务:http://localhost:3000/#/detail?keyword=VIN-HISTORY-SUMMARY&protocol=JT808'));
|
||||
});
|
||||
|
||||
test('opens same-day mileage statistics from quality issue row', async () => {
|
||||
|
||||
Reference in New Issue
Block a user