This commit is contained in:
2026-08-17 19:52:04 +08:00
parent d618683467
commit ee4cd35927
42 changed files with 702 additions and 226 deletions
@@ -0,0 +1,16 @@
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')
})
})