fix(admin): distinguish linked bookings from missing channel names
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { containerChannelLabel } from './containerChannelLabel'
|
||||
|
||||
describe('container actual channel label', () => {
|
||||
it('preserves the supplied channel name regardless of booking linkage', () => {
|
||||
expect(containerChannelLabel({ channelName: '纽约海铁', oceanBookingId: '123' })).toBe('纽约海铁')
|
||||
expect(containerChannelLabel({ channelName: '纽约海铁', oceanBookingId: null })).toBe('纽约海铁')
|
||||
})
|
||||
it('does not describe a linked booking as unlinked when the channel is absent', () => {
|
||||
expect(containerChannelLabel({ channelName: null, oceanBookingId: '123' })).toBe('—')
|
||||
expect(containerChannelLabel({ channelName: '', oceanBookingId: '123' })).toBe('—')
|
||||
})
|
||||
it('shows pending linkage only when both channel and booking are absent', () => {
|
||||
expect(containerChannelLabel({ channelName: null, oceanBookingId: null })).toBe('待关联订舱')
|
||||
expect(containerChannelLabel({ channelName: '', oceanBookingId: undefined })).toBe('待关联订舱')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user