feat(platform): collapse advanced dashboard workbench
This commit is contained in:
@@ -155,6 +155,89 @@ test('dashboard opens with a customer vehicle service path instead of protocol e
|
||||
expect(screen.getByRole('button', { name: '客户车辆服务路径 数据导出 数据能否交付 导出证据' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('dashboard keeps advanced customer workbench collapsed behind the service path', async () => {
|
||||
window.history.replaceState(null, '', '/#/dashboard');
|
||||
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
||||
const path = String(input);
|
||||
if (path.includes('/api/ops/health')) {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: {
|
||||
linkHealth: [],
|
||||
kafkaLag: 0,
|
||||
activeConnections: 15,
|
||||
redisOnlineKeys: 92,
|
||||
tdengineWritable: true,
|
||||
mysqlWritable: true,
|
||||
runtime: { requestTimeoutMs: 5000, amapWebJsConfigured: true, amapSecurityProxyEnabled: true, amapSecurityCodeExposed: false }
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
} as Response;
|
||||
}
|
||||
if (path.includes('/api/dashboard/summary')) {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: {
|
||||
onlineVehicles: 92,
|
||||
activeToday: 120,
|
||||
frameToday: 21000,
|
||||
issueVehicles: 7,
|
||||
kafkaLag: 0,
|
||||
protocols: [],
|
||||
serviceStatuses: [],
|
||||
linkHealth: []
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
} as Response;
|
||||
}
|
||||
if (path.includes('/api/vehicle-service/summary')) {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: {
|
||||
totalVehicles: 1033,
|
||||
boundVehicles: 988,
|
||||
onlineVehicles: 92,
|
||||
singleSourceVehicles: 170,
|
||||
multiSourceVehicles: 220,
|
||||
noDataVehicles: 15,
|
||||
identityRequiredVehicles: 9,
|
||||
serviceStatuses: [],
|
||||
protocols: [],
|
||||
missingSources: []
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
} as Response;
|
||||
}
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: { items: [], total: 0, limit: 8, offset: 0 },
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
} as Response;
|
||||
});
|
||||
|
||||
render(<App />);
|
||||
|
||||
expect(await screen.findByRole('heading', { name: '客户车辆服务路径' })).toBeInTheDocument();
|
||||
const summary = screen.getByText('客户进阶工作台');
|
||||
const details = summary.closest('details');
|
||||
expect(details).toBeInTheDocument();
|
||||
expect(details).not.toHaveAttribute('open');
|
||||
expect(within(details as HTMLElement).getByText('车辆服务指挥台')).toBeInTheDocument();
|
||||
expect(within(details as HTMLElement).getByText('车辆地图态势')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('topbar frames customer work as a vehicle service delivery strip', () => {
|
||||
vi.spyOn(globalThis, 'fetch').mockImplementation(async () => ({
|
||||
ok: true,
|
||||
|
||||
Reference in New Issue
Block a user