优化
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user