优化
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { oceanBookingStatusLabel, oceanBookingStatusOptions } from './status'
|
||||
|
||||
describe('ocean booking status labels', () => {
|
||||
it('translates every backend status for selectors and badges', () => {
|
||||
expect(oceanBookingStatusOptions).toEqual([
|
||||
{ value: 'DRAFT', label: '草稿' },
|
||||
{ value: 'SUBMITTED', label: '已提交' },
|
||||
{ value: 'CONFIRMED', label: '已确认' },
|
||||
{ value: 'RELEASED', label: '已放舱' },
|
||||
{ value: 'FAILED', label: '订舱失败' },
|
||||
{ value: 'CHANGE_PENDING', label: '变更中' },
|
||||
{ value: 'CANCELLED', label: '已取消' },
|
||||
])
|
||||
})
|
||||
|
||||
it('does not leak unknown backend enum values to users', () => {
|
||||
expect(oceanBookingStatusLabel('NEW_BACKEND_STATUS')).toBe('未知状态')
|
||||
expect(oceanBookingStatusLabel(null)).toBe('未设置')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user