17 lines
807 B
TypeScript
17 lines
807 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|||
|
|
import { notificationAppLabel, notificationCategoryLabel, notificationRecipientStatusLabel } from './presentation'
|
||
|
|
|
||
|
|
describe('notification presentation', () => {
|
||
|
|
it('maps known notification values to user-facing Chinese labels', () => {
|
||
|
|
expect(notificationCategoryLabel('ORDER')).toBe('订单消息')
|
||
|
|
expect(notificationAppLabel('MERCHANT')).toBe('企业客户端')
|
||
|
|
expect(notificationRecipientStatusLabel('DELIVERED')).toBe('已送达')
|
||
|
|
})
|
||
|
|
|
||
|
|
it('falls back to the original code for values added by the backend later', () => {
|
||
|
|
expect(notificationCategoryLabel('FUTURE_CATEGORY')).toBe('FUTURE_CATEGORY')
|
||
|
|
expect(notificationAppLabel('MOBILE')).toBe('MOBILE')
|
||
|
|
expect(notificationRecipientStatusLabel('QUEUED')).toBe('QUEUED')
|
||
|
|
})
|
||
|
|
})
|