This commit is contained in:
2026-08-11 19:35:28 +08:00
parent 886c7d3529
commit c690a30422
48 changed files with 935 additions and 171 deletions
@@ -0,0 +1,22 @@
import { describe, expect, it } from 'vitest'
import {
firstLegBusinessTypeLabel, firstLegContainerModeLabel, firstLegDestinationTypeLabel,
firstLegPickupMethodLabel, firstLegTaxModeLabel, firstLegTradeTermLabel, firstLegTransportModeLabel,
} from './firstLegBusinessLabels'
describe('first-leg business labels', () => {
it('translates business codes using the customer order contract', () => {
expect(firstLegTransportModeLabel('SEA')).toBe('海运')
expect(firstLegTradeTermLabel('FOB')).toBe('FOB(离岸价)')
expect(firstLegPickupMethodLabel('PICKUP')).toBe('平台上门提货')
expect(firstLegTaxModeLabel('BUY_DECLARATION')).toBe('买单报关')
expect(firstLegContainerModeLabel('FULL_CONTAINER')).toBe('整柜')
expect(firstLegDestinationTypeLabel('OVERSEAS')).toBe('海外仓')
expect(firstLegBusinessTypeLabel('EXPORT')).toBe('出口业务')
})
it('does not expose unknown backend codes', () => {
expect(firstLegTransportModeLabel('NEW_MODE')).toBe('未知类型')
expect(firstLegTaxModeLabel(null)).toBe('—')
})
})