-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformatClientSource.test.ts
More file actions
29 lines (24 loc) · 1.01 KB
/
Copy pathformatClientSource.test.ts
File metadata and controls
29 lines (24 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { describe, expect, it } from 'vitest'
import { formatClientSource } from './formatClientSource'
describe('formatClientSource', () => {
it('maps known codes to Russian labels', () => {
expect(formatClientSource('manual')).toBe('Вручную')
expect(formatClientSource('form')).toBe('Лендинг')
expect(formatClientSource('telegram_bot')).toBe('Telegram-бот')
expect(formatClientSource('max_bot')).toBe('Max-бот')
expect(formatClientSource('b24_sync')).toBe('Сделка B24')
expect(formatClientSource('b24_lead_sync')).toBe('Лид B24')
})
it('returns em dash for null', () => {
expect(formatClientSource(null)).toBe('—')
})
it('returns em dash for undefined', () => {
expect(formatClientSource(undefined)).toBe('—')
})
it('returns em dash for empty string', () => {
expect(formatClientSource('')).toBe('—')
})
it('returns the raw code when unknown', () => {
expect(formatClientSource('experimental_xyz')).toBe('experimental_xyz')
})
})