feat(platform): add vehicle service task board

This commit is contained in:
lingniu
2026-07-05 01:55:54 +08:00
parent 7642f9c9eb
commit 2c881dae7c
3 changed files with 159 additions and 1 deletions

View File

@@ -791,6 +791,12 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
expect(screen.getByText('客户常用工作流')).toBeInTheDocument();
expect(screen.getByText('实时车辆地图')).toBeInTheDocument();
expect(screen.getByText('历史数据导出')).toBeInTheDocument();
expect(screen.getByText('今日车辆服务任务板')).toBeInTheDocument();
expect(screen.getByText('先看全域在线')).toBeInTheDocument();
expect(screen.getByText('再看重点车辆')).toBeInTheDocument();
expect(screen.getByText('按时间窗复盘')).toBeInTheDocument();
expect(screen.getByText('导出证据数据')).toBeInTheDocument();
expect(screen.getByText('闭环告警通知')).toBeInTheDocument();
expect(screen.getByText('车辆服务入口')).toBeInTheDocument();
expect(screen.getByText('自定义时间监控')).toBeInTheDocument();
expect(screen.getByText('应用时间窗')).toBeInTheDocument();
@@ -844,6 +850,23 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
expect(window.location.hash).toBe('#/map?online=online');
cleanup();
await renderDashboard();
fireEvent.click(screen.getByRole('button', { name: '今日任务 先看全域在线 打开实时地图' }));
expect(window.location.hash).toBe('#/map?online=online');
cleanup();
await renderDashboard();
fireEvent.click(screen.getByRole('button', { name: '今日任务 按时间窗复盘 里程统计' }));
expect(window.location.hash.startsWith('#/mileage')).toBe(true);
expect(new URLSearchParams(window.location.hash.split('?')[1] ?? '').get('dateFrom')).toBeTruthy();
cleanup();
await renderDashboard();
fireEvent.click(screen.getByRole('button', { name: '今日任务 导出证据数据 历史导出' }));
expect(window.location.hash.startsWith('#/history-query')).toBe(true);
expect(new URLSearchParams(window.location.hash.split('?')[1] ?? '').get('includeFields')).toBe('true');
cleanup();
await renderDashboard();
fireEvent.click(screen.getByRole('button', { name: '客户工作流 历史数据导出' }));
expect(window.location.hash.startsWith('#/history-query')).toBe(true);
@@ -5528,7 +5551,10 @@ test('drills into quality issues by issue type', async () => {
render(<App />);
fireEvent.click(await screen.findByRole('button', { name: /主要问题 暂无数据来源 1/ }));
const issueButtons = await screen.findAllByRole('button', { name: /主要问题 暂无数据来源 1/ });
const issueSummaryButton = issueButtons[issueButtons.length - 1];
expect(issueButtons.length).toBeGreaterThanOrEqual(1);
fireEvent.click(issueSummaryButton as HTMLElement);
await waitFor(() => {
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('/api/alert-events?issueType=NO_SOURCE&limit=20&offset=0'), undefined);