fix(platform): unify degraded service wording

This commit is contained in:
lingniu
2026-07-04 08:03:24 +08:00
parent 4251ea5235
commit 5fa7858662
10 changed files with 40 additions and 40 deletions

View File

@@ -31,7 +31,7 @@ test('shows vehicle service status distribution on dashboard', async () => {
protocols: [],
serviceStatuses: [
{ status: 'healthy', title: '服务正常', count: 12 },
{ status: 'degraded', title: '部分来源离线', count: 39 }
{ status: 'degraded', title: '来源不完整', count: 39 }
],
linkHealth: []
},
@@ -53,7 +53,7 @@ test('shows vehicle service status distribution on dashboard', async () => {
render(<App />);
expect(await screen.findByText('车辆服务状态')).toBeInTheDocument();
expect(screen.getByText('部分来源离线')).toBeInTheDocument();
expect(screen.getByText('来源不完整')).toBeInTheDocument();
expect(screen.getByText('39')).toBeInTheDocument();
});
@@ -94,7 +94,7 @@ test('dashboard renders vehicle service summary metrics', async () => {
identityRequiredVehicles: 9,
serviceStatuses: [
{ status: 'healthy', title: '服务正常', count: 161 },
{ status: 'degraded', title: '部分来源离线', count: 41 }
{ status: 'degraded', title: '来源不完整', count: 41 }
],
protocols: [
{ protocol: 'JT808', online: 157, total: 388 },
@@ -310,7 +310,7 @@ test('shows vehicle service result summary on vehicle list filters', async () =>
serviceStatus: {
status: 'degraded',
severity: 'warning',
title: '部分来源离线',
title: '来源不完整',
detail: '1/2 个来源在线',
sourceCount: 2,
onlineSourceCount: 1
@@ -913,7 +913,7 @@ test('filters dashboard coverage from source consistency diagnosis', async () =>
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('serviceStatus=degraded'), undefined);
});
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('missingProtocol=JT808'), undefined);
expect(screen.getByText('当前筛选:来源异常 / 缺 JT808')).toBeInTheDocument();
expect(screen.getByText('当前筛选:来源不完整 / 缺 JT808')).toBeInTheDocument();
});
test('opens full vehicle service list from dashboard coverage filters', async () => {
@@ -1251,13 +1251,13 @@ test('filters dashboard coverage by service status', async () => {
expect(await screen.findByText('车辆服务覆盖')).toBeInTheDocument();
fireEvent.click(screen.getByTestId('dashboard-service-status-filter'));
fireEvent.click(await screen.findByText('来源异常'));
fireEvent.click(await screen.findByText('来源不完整'));
fireEvent.click(screen.getByRole('button', { name: '筛选' }));
await waitFor(() => {
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('serviceStatus=degraded'), undefined);
});
expect(screen.getByText('当前筛选:来源异常')).toBeInTheDocument();
expect(screen.getByText('当前筛选:来源不完整')).toBeInTheDocument();
});
test('filters dashboard coverage by missing source evidence', async () => {
@@ -1322,7 +1322,7 @@ test('opens dashboard coverage from service status distribution', async () => {
kafkaLag: 0,
protocols: [],
serviceStatuses: [
{ status: 'degraded', title: '部分来源离线', count: 39 }
{ status: 'degraded', title: '来源不完整', count: 39 }
],
linkHealth: []
},
@@ -1343,7 +1343,7 @@ test('opens dashboard coverage from service status distribution', async () => {
render(<App />);
fireEvent.click(await screen.findByRole('button', { name: '查看部分来源离线' }));
fireEvent.click(await screen.findByRole('button', { name: '查看来源不完整' }));
await waitFor(() => {
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('serviceStatus=degraded'), undefined);
@@ -1816,7 +1816,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 () => {
@@ -2769,7 +2769,7 @@ test('shows canonical service status in realtime vehicles', async () => {
serviceStatus: {
status: 'degraded',
severity: 'warning',
title: '部分来源离线',
title: '来源不完整',
detail: '由实时车辆 API 统一判定',
sourceCount: 2,
onlineSourceCount: 1
@@ -2797,7 +2797,7 @@ test('shows canonical service status in realtime vehicles', async () => {
render(<App />);
expect(await screen.findByText('VIN-RT-DEGRADED')).toBeInTheDocument();
expect(screen.getByText('部分来源离线')).toBeInTheDocument();
expect(screen.getByText('来源不完整')).toBeInTheDocument();
});
test('frames realtime page as one vehicle service with source evidence', async () => {
@@ -2983,7 +2983,7 @@ test('shows vehicle service status in vehicle list', async () => {
serviceStatus: {
status: 'degraded',
severity: 'warning',
title: '部分来源离线',
title: '来源不完整',
detail: '由车辆服务 API 统一判定',
sourceCount: 2,
onlineSourceCount: 1
@@ -3014,7 +3014,7 @@ test('shows vehicle service status in vehicle list', async () => {
expect(await screen.findByText('VIN-DEGRADED-001')).toBeInTheDocument();
expect(screen.getByText('车辆服务状态')).toBeInTheDocument();
expect(screen.getByText('部分来源离线')).toBeInTheDocument();
expect(screen.getByText('来源不完整')).toBeInTheDocument();
});
test('shows source consistency diagnosis in vehicle service list', async () => {
@@ -3373,7 +3373,7 @@ test('filters vehicle list by service status', async () => {
await screen.findByRole('heading', { name: '车辆服务' });
fireEvent.click(screen.getByTestId('service-status-filter'));
fireEvent.click(await screen.findByText('来源异常'));
fireEvent.click(await screen.findByText('来源不完整'));
fireEvent.click(screen.getByRole('button', { name: '查询' }));
await waitFor(() => {
@@ -3500,7 +3500,7 @@ test('shows unified service overview on vehicle detail', async () => {
serviceStatus: {
status: 'degraded',
severity: 'warning',
title: '部分来源离线',
title: '来源不完整',
detail: '2/3 个来源在线',
sourceCount: 3,
onlineSourceCount: 2
@@ -3569,7 +3569,7 @@ test('shows vehicle service evidence chain before source details', async () => {
serviceStatus: {
status: 'degraded',
severity: 'warning',
title: '部分来源离线',
title: '来源不完整',
detail: '2/3 个来源在线',
sourceCount: 3,
onlineSourceCount: 2
@@ -3583,7 +3583,7 @@ test('shows vehicle service evidence chain before source details', async () => {
scope: 'vehicle',
status: 'degraded',
severity: 'warning',
title: '部分来源离线',
title: '来源不完整',
detail: 'MQTT 离线32960 与 808 仍可支撑车辆服务'
},
sources: ['GB32960', 'JT808', 'YUTONG_MQTT'],
@@ -4145,7 +4145,7 @@ test('shows selected source scope on vehicle detail', async () => {
serviceStatus: {
status: 'degraded',
severity: 'warning',
title: '部分来源离线',
title: '来源不完整',
detail: '1/2 个来源在线,车辆服务可用但需要关注离线来源。',
sourceCount: 2,
onlineSourceCount: 1
@@ -4178,7 +4178,7 @@ test('shows selected source scope on vehicle detail', async () => {
expect(await screen.findByText('当前查看范围')).toBeInTheDocument();
expect(screen.getByText('单一来源JT808')).toBeInTheDocument();
expect(screen.getByText('车辆服务状态')).toBeInTheDocument();
expect(screen.getByText('部分来源离线')).toBeInTheDocument();
expect(screen.getByText('来源不完整')).toBeInTheDocument();
expect(fetchMock).toHaveBeenCalledWith(expect.stringContaining('/api/vehicle-service?keyword=VIN001&protocol=JT808'), undefined);
});