feat(platform): clarify missing source role
This commit is contained in:
@@ -49,6 +49,9 @@ function formatSeconds(value?: number) {
|
||||
function sourceServiceRole(source: VehicleSourceStatus, primaryProtocol?: string) {
|
||||
if (source.protocol === primaryProtocol) return { label: '主来源', color: 'blue' as const };
|
||||
if (source.online) return { label: '在线证据', color: 'green' as const };
|
||||
if (!source.lastSeen && !source.hasRealtime && !source.hasHistory && !source.hasRaw && !source.hasMileage) {
|
||||
return { label: '暂无来源', color: 'grey' as const };
|
||||
}
|
||||
return { label: '离线证据', color: 'grey' as const };
|
||||
}
|
||||
|
||||
|
||||
@@ -1868,7 +1868,7 @@ test('switches vehicle detail to a source from the source matrix', async () => {
|
||||
expect(screen.getByText('车辆服务角色')).toBeInTheDocument();
|
||||
expect(screen.getByText('主来源')).toBeInTheDocument();
|
||||
expect(screen.getByText('在线证据')).toBeInTheDocument();
|
||||
expect(screen.getByText('离线证据')).toBeInTheDocument();
|
||||
expect(screen.getByText('暂无来源')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('YUTONG_MQTT').length).toBeGreaterThan(0);
|
||||
expect(screen.getAllByText('无上报').length).toBeGreaterThan(0);
|
||||
fireEvent.click(screen.getByRole('button', { name: '仅看 JT808' }));
|
||||
|
||||
Reference in New Issue
Block a user