修改提交

This commit is contained in:
2026-09-22 08:47:43 +08:00
parent 6e0144d7cd
commit 2e2f3ed2d2
9 changed files with 166 additions and 9 deletions
@@ -2,6 +2,19 @@ import { describe, expect, it } from 'vitest'
import { formatOverseasDateTime, inboundPlanStatusLabel, inventoryBusinessTypeLabel, lastMileOrderReference, lastMileStatusLabel, packageDifferenceText, relabelBusinessStatusLabel, toLastMileOrderListItem } from './lastMilePresentation'
describe('last-mile order presentation adapter', () => {
it('keeps completed and processing relabel applications visible together', () => {
const row = toLastMileOrderListItem({
id: '1', customerId: 'customer-1', orderNo: 'RT-001', currentStatus: 'INBOUND_COMPLETED',
relabelApplications: [
{ relabelNo: 'RL-FIRST', status: 'COMPLETED', quantity: 10, createdAt: '2026-09-21T10:00:00' },
{ relabelNo: 'RL-SECOND', status: 'PROCESSING', quantity: 5, createdAt: '2026-09-21T11:00:00' },
],
})
expect(row.relabelApplications?.map(item => [item.relabelNo, item.statusLabel, item.quantity])).toEqual([
['RL-FIRST', '已完成', 10], ['RL-SECOND', '处理中', 5],
])
})
it('formats overseas timestamps with zero-padded seconds', () => {
expect(formatOverseasDateTime('2026-08-27T16:19:46')).toBe('2026-08-27 16:19:46')
expect(formatOverseasDateTime('2026-08-07T06:09:04')).toBe('2026-08-07 06:09:04')