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

View File

@@ -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');
});