This commit is contained in:
2026-09-11 16:17:21 +08:00
parent 80a4b3ab5e
commit 737dd41ff1
24 changed files with 202 additions and 229 deletions
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest'
import {
SMART_LOADING_CHANNEL_GROUPS,
SMART_LOADING_WAREHOUSE_GROUPS,
isSeaRailChannel,
resolveSmartLoadingChannelGroup,
resolveSmartLoadingWarehouseGroup,
} from './smartLoadingChannelGroups'
@@ -33,6 +34,11 @@ describe('smartLoadingChannelGroups', () => {
expect(resolveSmartLoadingChannelGroup('UNKNOWN', '未确认新渠道')).toBeNull()
})
it('identifies canonical and legacy sea-rail channel codes', () => {
expect(['EXX_RAIL_NY', 'NYEXX', 'OA_CHICAGO_RAIL', 'CPHT'].every(isSeaRailChannel)).toBe(true)
expect(isSeaRailChannel('OA_LA_TRUCK')).toBe(false)
})
it('exposes Yiwu and Dongguan as the fixed top-level warehouses', () => {
expect(SMART_LOADING_WAREHOUSE_GROUPS.map((group) => group.name)).toEqual(['义乌仓', '东莞仓'])
expect(resolveSmartLoadingWarehouseGroup('义乌国内仓')?.code).toBe('YIWU')