This commit is contained in:
2026-09-15 15:20:28 +08:00
parent 01cbe69eb4
commit ea30e3f37a
8 changed files with 76 additions and 15 deletions
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
import { formatOverseasDateTime, inventoryBusinessTypeLabel, lastMileOrderReference, toLastMileOrderListItem } from './lastMilePresentation'
import { formatOverseasDateTime, inventoryBusinessTypeLabel, lastMileOrderReference, relabelBusinessStatusLabel, toLastMileOrderListItem } from './lastMilePresentation'
describe('last-mile order presentation adapter', () => {
it('formats overseas timestamps with zero-padded seconds', () => {
@@ -89,6 +89,7 @@ describe('last-mile order presentation adapter', () => {
['WAREHOUSE_TRANSFER', '仓储转运'],
['RETURN_RELABEL', '退货换标'],
['LOCAL_LOOSEBOARD', '本土散板'],
['CARGO_DISCARD', '货物废弃订单'],
])('maps %s to its Chinese display name', (orderType, expected) => {
const row = toLastMileOrderListItem({ id: '1', customerId: '100', orderNo: 'LL-1', orderType })
expect(row.orderType).toBe(expected)
@@ -102,4 +103,14 @@ describe('last-mile order presentation adapter', () => {
expect(row.palletMergeRelation).toBe('NYEXX2608280001、NYEXX2608280002')
})
it.each([
['PENDING_PROCESSING', '待处理'],
['PROCESSING', '处理中'],
['CUSTOMER_CONFIRM_PENDING', '待处理'],
['READY_FOR_OUTBOUND', '换标完成'],
['COMPLETED', '换标完成'],
])('collapses internal relabel node %s into business status %s', (status, expected) => {
expect(relabelBusinessStatusLabel(status)).toBe(expected)
})
})