17 lines
613 B
TypeScript
17 lines
613 B
TypeScript
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: 'RELEASED', label: '已放舱' },
|
|
])
|
|
})
|
|
|
|
it('does not leak unknown backend enum values to users', () => {
|
|
expect(oceanBookingStatusLabel('NEW_BACKEND_STATUS')).toBe('未知状态')
|
|
expect(oceanBookingStatusLabel(null)).toBe('未设置')
|
|
})
|
|
})
|