feat(platform): add realtime duty handoff

This commit is contained in:
lingniu
2026-07-04 21:02:59 +08:00
parent 4077de9296
commit fa9c088dec
2 changed files with 109 additions and 0 deletions
@@ -8541,6 +8541,15 @@ test('copies realtime operations summary from realtime page', async () => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('实时监控:http://localhost:3000/#/realtime?keyword=VIN-RT-SUMMARY-003&protocol=JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹回放:http://localhost:3000/#/history?keyword=VIN-RT-SUMMARY-003&protocol=JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('告警事件:http://localhost:3000/#/alert-events?keyword=VIN-RT-SUMMARY-003&protocol=JT808'));
fireEvent.click(screen.getByRole('button', { name: '复制实时值班交接包' }));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【实时值班交接包】'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('页面车辆:3 / 总计 3;版本:'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('在线:2;离线:1;定位有效:2;降级:2;超时:'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('来源覆盖:GB32960:在线 1/1,实时 1/1JT808:在线 1/2,实时 2/2YUTONG_MQTT:在线 0/1,实时 1/1'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('值班入口:http://localhost:3000/#/realtime?protocol=JT808&online=online'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务:http://localhost:3000/#/detail?keyword=VIN-RT-SUMMARY-003&protocol=JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('里程统计:http://localhost:3000/#/mileage?keyword=VIN-RT-SUMMARY-003&protocol=JT808'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('历史RAWhttp://localhost:3000/api/history/raw-frames?protocol=JT808&vin=VIN-RT-SUMMARY-003&limit=20&includeFields=true'));
fireEvent.click(screen.getByRole('button', { name: '实时筛选 降级服务 2' }));
expect(window.location.hash).toBe('#/realtime?protocol=JT808&serviceStatus=degraded&online=online');
});