feat(platform): add dashboard map operations panel
This commit is contained in:
@@ -342,7 +342,23 @@ test('dashboard presents one vehicle service operating posture', async () => {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: { linkHealth: [], kafkaLag: 0, activeConnections: 0, capacityFindings: [], redisOnlineKeys: 0, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000 } },
|
||||
data: {
|
||||
linkHealth: [],
|
||||
kafkaLag: 0,
|
||||
activeConnections: 0,
|
||||
capacityFindings: [],
|
||||
redisOnlineKeys: 0,
|
||||
tdengineWritable: true,
|
||||
mysqlWritable: true,
|
||||
runtime: {
|
||||
requestTimeoutMs: 5000,
|
||||
amapWebJsConfigured: true,
|
||||
amapApiConfigured: true,
|
||||
amapSecurityProxyEnabled: true,
|
||||
amapSecurityCodeExposed: false,
|
||||
amapSecurityServiceHost: '/_AMapService'
|
||||
}
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
@@ -419,7 +435,23 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: { linkHealth: [], kafkaLag: 0, activeConnections: 0, capacityFindings: [], redisOnlineKeys: 0, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000 } },
|
||||
data: {
|
||||
linkHealth: [],
|
||||
kafkaLag: 0,
|
||||
activeConnections: 0,
|
||||
capacityFindings: [],
|
||||
redisOnlineKeys: 0,
|
||||
tdengineWritable: true,
|
||||
mysqlWritable: true,
|
||||
runtime: {
|
||||
requestTimeoutMs: 5000,
|
||||
amapWebJsConfigured: true,
|
||||
amapApiConfigured: true,
|
||||
amapSecurityProxyEnabled: true,
|
||||
amapSecurityCodeExposed: false,
|
||||
amapSecurityServiceHost: '/_AMapService'
|
||||
}
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
@@ -513,7 +545,15 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
|
||||
|
||||
await renderDashboard();
|
||||
expect(screen.getByText('车辆服务作业台')).toBeInTheDocument();
|
||||
expect(screen.getByText('地图运营能力')).toBeInTheDocument();
|
||||
expect(screen.getByText('车联网场景导航')).toBeInTheDocument();
|
||||
expect(screen.getByText('高德 Web JS')).toBeInTheDocument();
|
||||
expect(screen.getByText('服务端 API')).toBeInTheDocument();
|
||||
expect(screen.getByText('安全代理')).toBeInTheDocument();
|
||||
expect(screen.getByText('安全码暴露')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('已配置').length).toBeGreaterThanOrEqual(2);
|
||||
expect(screen.getByText('已启用')).toBeInTheDocument();
|
||||
expect(screen.getByText('未暴露')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('实时地图').length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getAllByText('实时监控').length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getAllByText('轨迹回放').length).toBeGreaterThanOrEqual(1);
|
||||
@@ -538,9 +578,21 @@ test('dashboard exposes vehicle data center capability matrix', async () => {
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【车辆数据中台功能蓝图】'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('32960 / 808 / 宇通 MQTT 都只是车辆服务证据源'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('车辆规模:1,033;在线:208;告警:7'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('高德地图:Web JS 已配置;服务端 API 已配置;安全代理 已启用;安全码未暴露'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('1. 实时监控'));
|
||||
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('SLA:目标 0-1 秒内进入实时视图'));
|
||||
|
||||
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('#/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).toBe('#/map?online=online');
|
||||
cleanup();
|
||||
@@ -1002,7 +1054,7 @@ test('dashboard exposes end-to-end operations workflow entries', async () => {
|
||||
expect(screen.getByText('接入巡检')).toBeInTheDocument();
|
||||
expect(screen.getByText('实时态势')).toBeInTheDocument();
|
||||
expect(screen.getByText('轨迹复盘')).toBeInTheDocument();
|
||||
expect(screen.getByText('历史证据')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('历史证据').length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getAllByText('告警事件').length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getByText('统计复核')).toBeInTheDocument();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user