import { describe, expect, test } from 'vitest'; import { protocolDisplayLabel, protocolSourceLabel } from './protocols'; describe('protocol display vocabulary', () => { test('uses one user-facing label for every supported vehicle protocol', () => { expect(protocolDisplayLabel('GB32960')).toBe('GB/T 32960'); expect(protocolDisplayLabel('JT808')).toBe('JT/T 808'); expect(protocolDisplayLabel('YUTONG_MQTT')).toBe('宇通 MQTT'); }); test('keeps unknown protocols intact and explains qualified sources', () => { expect(protocolDisplayLabel('CUSTOM')).toBe('CUSTOM'); expect(protocolSourceLabel('YUTONG_MQTT:canonical')).toBe('宇通 MQTT · canonical'); expect(protocolSourceLabel('CUSTOM:gateway')).toBe('CUSTOM:gateway'); }); });