This commit is contained in:
2026-08-11 18:43:56 +08:00
parent 6456278ec8
commit 6622815d6c
37 changed files with 739 additions and 205 deletions
@@ -7,6 +7,7 @@ import UnifiedOrderWorkflowPanel from './UnifiedOrderWorkflowPanel.vue'
import {
getEvidence,
getOutboundDispatch,
getPicking,
getPreload,
smartSplit,
voidEvidence,
@@ -18,6 +19,7 @@ vi.mock('../api', async (importOriginal) => {
...original,
getEvidence: vi.fn(),
getOutboundDispatch: vi.fn(),
getPicking: vi.fn(),
getPreload: vi.fn(),
smartSplit: vi.fn(),
voidEvidence: vi.fn(),
@@ -50,6 +52,7 @@ describe('UnifiedOrderWorkflowPanel preload editor', () => {
beforeEach(() => {
vi.mocked(getOutboundDispatch).mockReset().mockResolvedValue(null as never)
vi.mocked(getEvidence).mockReset().mockResolvedValue({ inboundId: '2086085512165634051', evidences: [] })
vi.mocked(getPicking).mockReset().mockResolvedValue({ id: '51', inboundId: '2086085512165634051', status: 'PICKING', version: 2, expectedCount: 10, pickedCount: 4, remark: null })
vi.mocked(getPreload).mockReset().mockResolvedValue(preload('REF-OLD'))
vi.mocked(smartSplit).mockReset()
vi.mocked(voidEvidence).mockReset()
@@ -156,4 +159,37 @@ describe('UnifiedOrderWorkflowPanel preload editor', () => {
)
prompt.mockRestore()
})
it('renders booking, trucking and picking backend statuses as business Chinese', async () => {
vi.mocked(getOutboundDispatch).mockResolvedValue({
orderId: '1', orderNo: 'ORD-1', inboundId: '2', inboundCode: 'IN-2', containerBookingId: '3', containerNo: 'CONT-3',
loadingPlanId: '4', loadingPlanStatus: 'LOADING', oceanBookingId: '5', oceanBookingStatus: 'RELEASED',
truckAppointmentId: '6', truckAppointmentStatus: 'PICKUP_IN_PROGRESS', gate: { passed: false, items: [] },
})
const wrapper = mountPanel(['platform:firstleg:inbound:picking:view'], 'LOADING')
await flushPromises()
expect(wrapper.text()).toContain('已放舱')
expect(wrapper.text()).toContain('提柜中')
expect(wrapper.text()).toContain('拣货中')
expect(wrapper.text()).not.toContain('RELEASED')
expect(wrapper.text()).not.toContain('PICKUP_IN_PROGRESS')
expect(wrapper.text()).not.toContain('PICKING')
})
it('does not expose unknown backend enum values', async () => {
vi.mocked(getOutboundDispatch).mockResolvedValue({
orderId: '1', orderNo: 'ORD-1', inboundId: '2', inboundCode: 'IN-2', containerBookingId: null, containerNo: null,
loadingPlanId: null, loadingPlanStatus: null, oceanBookingId: '5', oceanBookingStatus: 'NEW_BOOKING_STATE',
truckAppointmentId: '6', truckAppointmentStatus: 'NEW_TRUCK_STATE', gate: { passed: false, items: [] },
})
vi.mocked(getPicking).mockResolvedValue({ id: '51', inboundId: '2', status: 'NEW_PICK_STATE', version: 2, expectedCount: null, pickedCount: null, remark: null })
const wrapper = mountPanel(['platform:firstleg:inbound:picking:view'], 'LOADING')
await flushPromises()
expect(wrapper.text()).toContain('未知状态')
expect(wrapper.text()).not.toContain('NEW_BOOKING_STATE')
expect(wrapper.text()).not.toContain('NEW_TRUCK_STATE')
expect(wrapper.text()).not.toContain('NEW_PICK_STATE')
})
})