feat(platform): preserve vehicle context in customer tasks

This commit is contained in:
lingniu
2026-07-05 19:07:50 +08:00
parent e48ea7d22a
commit 08c275af34
4 changed files with 53 additions and 5 deletions

View File

@@ -2945,6 +2945,15 @@ test('shows resolved vehicle service status after topbar search', async () => {
expect(screen.getByText('一致性:数据通道不完整')).toBeInTheDocument();
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('/api/vehicle-service/overview?keyword=%E7%B2%A4AG18312'), undefined);
expect(fetchMock).not.toHaveBeenCalledWith(expect.stringContaining('/api/vehicles/resolve'), undefined);
fireEvent.click(screen.getByRole('button', { name: '客户任务 轨迹回放 这段时间怎么跑' }));
expect(window.location.hash).toBe('#/history?keyword=LB9A32A24R0LS1426&protocol=JT808');
fireEvent.click(screen.getByRole('button', { name: '客户任务 统计查询 里程怎么算' }));
expect(window.location.hash).toBe('#/mileage?keyword=LB9A32A24R0LS1426&protocol=JT808');
fireEvent.click(screen.getByRole('button', { name: '客户任务 数据导出 证据怎么给客户' }));
expect(window.location.hash).toBe('#/history-query?keyword=LB9A32A24R0LS1426&protocol=JT808&tab=raw');
fireEvent.click(screen.getByRole('button', { name: '客户任务 告警通知 异常谁处理' }));
expect(window.location.hash).toBe('#/alert-events?keyword=LB9A32A24R0LS1426&protocol=JT808');
});
test('shows row service status in dashboard vehicle previews', async () => {