Files
admin-web/src/modules/notifications/presentation.test.ts
T

17 lines
807 B
TypeScript
Raw Normal View History

2026-08-17 19:52:04 +08:00
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')
})
})