feat(platform): add vehicle dispatch checklist
This commit is contained in:
@@ -10,6 +10,15 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
test('renders vehicle platform shell', () => {
|
||||
vi.spyOn(globalThis, 'fetch').mockImplementation(async () => ({
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: { items: [], total: 0, limit: 20, offset: 0, linkHealth: [], runtime: { requestTimeoutMs: 5000 } },
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
}) as Response);
|
||||
|
||||
render(<App />);
|
||||
expect(screen.getByText('车辆服务中台')).toBeInTheDocument();
|
||||
expect(screen.getByText('一车一服务 / 多源归并')).toBeInTheDocument();
|
||||
@@ -125,7 +134,7 @@ test('exposes AMap operations shortcuts when map key is configured', async () =>
|
||||
render(<App />);
|
||||
|
||||
expect(await screen.findByText('地图就绪')).toBeInTheDocument();
|
||||
expect(screen.getByText((content) => content.includes('platform-20260704153357'))).toBeInTheDocument();
|
||||
expect(await screen.findByText((content) => content.includes('platform-20260704153357'))).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('button', { name: '顶部地图态势' }));
|
||||
expect(window.location.hash).toBe('#/map');
|
||||
expect(await screen.findByRole('heading', { name: '实时地图' })).toBeInTheDocument();
|
||||
@@ -1749,6 +1758,19 @@ test('copies vehicle governance summary from vehicle center', async () => {
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('处置队列:'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('[P0] 维护身份绑定 4'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('[P1] 补齐 YUTONG_MQTT 来源 8'));
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: '复制当前页处置清单' }));
|
||||
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【车辆处置清单】'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('当前筛选:缺失来源:YUTONG_MQTT'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('当前页:1 辆 / 总计 12 辆'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('1. 车牌 粤A治理1 / VIN VIN-GOV-001 / 手机号 - / OEM G7s'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('状态:来源不完整;在线:在线;来源:1/1 来源在线,缺 YUTONG_MQTT;最后时间:2026-07-03 20:12:10'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('建议动作:补齐 YUTONG_MQTT 来源'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆服务:http://localhost:3000/#/detail?keyword=VIN-GOV-001&protocol=JT808'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('实时监控:http://localhost:3000/#/realtime?keyword=VIN-GOV-001&protocol=JT808'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('轨迹回放:http://localhost:3000/#/history?keyword=VIN-GOV-001&protocol=JT808'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('告警事件:http://localhost:3000/#/alert-events?keyword=VIN-GOV-001&protocol=JT808'));
|
||||
});
|
||||
|
||||
test('filters vehicle list from recommended action', async () => {
|
||||
|
||||
Reference in New Issue
Block a user