feat(platform): refine customer service navigation

This commit is contained in:
lingniu
2026-07-05 12:43:46 +08:00
parent 9c6973b4ee
commit 9f5a091b87
3 changed files with 45 additions and 38 deletions

View File

@@ -21,18 +21,18 @@ test('renders vehicle platform shell', () => {
render(<App />);
expect(screen.getByText('车辆服务中台')).toBeInTheDocument();
expect(screen.getByText('地图监控 / 轨迹回放 / 告警通知')).toBeInTheDocument();
expect(screen.getByText('车辆监控')).toBeInTheDocument();
expect(screen.getByText('实时看车在哪里、是否在线、是否异常')).toBeInTheDocument();
expect(screen.getByText('车辆资产')).toBeInTheDocument();
expect(screen.getByText('按 VIN、车牌、手机号管理车辆资产')).toBeInTheDocument();
expect(screen.getByText('轨迹与统计')).toBeInTheDocument();
expect(screen.getByText('按时间窗回放轨迹、核对里程、导出数据')).toBeInTheDocument();
expect(screen.getByText('实时地图 / 轨迹里程 / 告警通知')).toBeInTheDocument();
expect(screen.getByText('实时运营')).toBeInTheDocument();
expect(screen.getByText('地图看车、在线监控、异常优先')).toBeInTheDocument();
expect(screen.getAllByText('车辆服务').length).toBeGreaterThanOrEqual(1);
expect(screen.getByText('按 VIN、车牌、手机号管理车辆')).toBeInTheDocument();
expect(screen.getByText('轨迹里程')).toBeInTheDocument();
expect(screen.getByText('回放轨迹、核对里程、查询历史')).toBeInTheDocument();
expect(screen.getAllByText('告警通知').length).toBeGreaterThanOrEqual(1);
expect(screen.getByText('内部运维')).toBeInTheDocument();
expect(screen.getByText('接入运维')).toBeInTheDocument();
expect(screen.getAllByText('客户').length).toBeGreaterThanOrEqual(3);
expect(screen.getByText('内部')).toBeInTheDocument();
expect(screen.getByText('客户主流程外查看接入链路和运行质量')).toBeInTheDocument();
expect(screen.getByText('客户主流程外查看链路质量')).toBeInTheDocument();
expect(screen.getAllByText('运营总览').length).toBeGreaterThanOrEqual(1);
});
@@ -205,7 +205,7 @@ test('exposes AMap operations shortcuts when map key is configured', async () =>
expect(window.location.hash).toBe('#/realtime');
fireEvent.click(screen.getByRole('button', { name: '顶部轨迹回放' }));
expect(window.location.hash.startsWith('#/history')).toBe(true);
fireEvent.click(screen.getByRole('button', { name: '顶部数据导出' }));
fireEvent.click(screen.getByRole('button', { name: '顶部历史数据' }));
expect(window.location.hash.startsWith('#/history-query')).toBe(true);
expect(new URLSearchParams(window.location.hash.split('?')[1] ?? '').get('tab')).toBe('raw');
expect(await screen.findByRole('heading', { name: '历史查询导出' })).toBeInTheDocument();
@@ -809,13 +809,13 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
expect(screen.getByRole('button', { name: '车辆服务指挥台 数据交付与导出 历史导出' })).toBeInTheDocument();
expect(screen.getByText('客户常用服务')).toBeInTheDocument();
expect(screen.getAllByText('车辆地图').length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText('数据导出').length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText('历史数据').length).toBeGreaterThanOrEqual(1);
expect(screen.getByText('车辆服务路径')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆服务路径 定位车辆 车辆地图' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆服务路径 查看状态 实时监控' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆服务路径 复盘轨迹 轨迹回放' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆服务路径 统计里程 里程统计' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆服务路径 导出交付 数据导出' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '车辆服务路径 查询导出 历史数据' })).toBeInTheDocument();
expect(screen.getByText('今日车辆服务任务板')).toBeInTheDocument();
expect(screen.getByText('先看全域在线')).toBeInTheDocument();
expect(screen.getByText('再看重点车辆')).toBeInTheDocument();
@@ -927,7 +927,7 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
cleanup();
await renderDashboard();
fireEvent.click(screen.getByRole('button', { name: '客户工作流 数据导出' }));
fireEvent.click(screen.getByRole('button', { name: '客户工作流 历史数据' }));
expect(window.location.hash.startsWith('#/history-query')).toBe(true);
expect(new URLSearchParams(window.location.hash.split('?')[1] ?? '').get('tab')).toBe('raw');
expect(new URLSearchParams(window.location.hash.split('?')[1] ?? '').get('includeFields')).toBe('true');
@@ -2821,9 +2821,9 @@ test('shows resolved vehicle service status after topbar search', async () => {
fireEvent.change(screen.getByPlaceholderText('搜索 VIN / 车牌 / 手机号'), { target: { value: '粤AG18312' } });
fireEvent.click(screen.getByRole('button', { name: '查询车辆' }));
expect(await screen.findByText('当前车辆:来源不完整')).toBeInTheDocument();
expect(await screen.findByText('当前车辆:数据通道不完整')).toBeInTheDocument();
expect(screen.getByText('粤AG18312 / LB9A32A24R0LS1426')).toBeInTheDocument();
expect(screen.getByText('一致性:来源不完整')).toBeInTheDocument();
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);
});
@@ -6121,7 +6121,7 @@ test('shows vehicle context when opening detail from shareable hash', async () =
render(<App />);
expect(await screen.findByText('粤AG18312 / VIN001')).toBeInTheDocument();
expect(screen.getByText('当前车辆:来源不完整')).toBeInTheDocument();
expect(screen.getByText('当前车辆:数据通道不完整')).toBeInTheDocument();
});
test('refreshes vehicle context when hash changes to another detail vehicle', async () => {