merge: integrate TEST changes with fleet photo updates
This commit is contained in:
@@ -209,6 +209,33 @@ async function chooseContainer(wrapper: Awaited<ReturnType<typeof mountView>>) {
|
||||
}
|
||||
|
||||
describe('LastMileOrdersView pending order and container conversion', () => {
|
||||
it('opens the same inbound-code detail from all and before departure despite different order IDs', async () => {
|
||||
const wrapper = await mountView()
|
||||
const vm = wrapper.vm as unknown as { openDetail(row: object): void }
|
||||
const row = { ...selectedRow(), orderTypeCode: 'FIRST_LEG', containerNode: '—' }
|
||||
routerPush.mockClear()
|
||||
vm.openDetail(row)
|
||||
expect(routerPush).toHaveBeenLastCalledWith({ name: 'unified-order-detail-by-inbound-code', params: { inboundCode: row.inboundCode }, query: { tenantId: customerId, from: 'last-mile-orders' } })
|
||||
await wrapper.findAll('[role="tab"]').find(tab => tab.text() === '开船前')!.trigger('click')
|
||||
await flushPromises()
|
||||
vm.openDetail({ ...row, id: '9007199254740999', orderNo: '—' })
|
||||
expect(routerPush).toHaveBeenLastCalledWith({ name: 'unified-order-detail-by-inbound-code', params: { inboundCode: row.inboundCode }, query: { tenantId: customerId, from: 'last-mile-orders' } })
|
||||
vm.openDetail({ ...row, containerNode: 'ACTUAL_DEPARTURE' })
|
||||
expect(routerPush).toHaveBeenLastCalledWith({ name: 'overseas-last-mile-order-detail', params: { orderId: row.id } })
|
||||
})
|
||||
|
||||
it('only uses the domestic ID fallback for source rows without an inbound code', async () => {
|
||||
const wrapper = await mountView()
|
||||
const vm = wrapper.vm as unknown as { openDetail(row: object): void }
|
||||
const row = { ...selectedRow(), orderTypeCode: 'FIRST_LEG', containerNode: '—', inboundCode: '—', orderNo: '—' }
|
||||
routerPush.mockClear()
|
||||
vm.openDetail(row)
|
||||
expect(routerPush).toHaveBeenCalledWith({ name: 'unified-order-detail', params: { orderId: row.id }, query: { tenantId: customerId, from: 'last-mile-orders' } })
|
||||
routerPush.mockClear()
|
||||
vm.openDetail({ ...row, orderNo: 'WC-1' })
|
||||
expect(routerPush).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('keeps return row statistics across pages without rendering the long summary blocks', async () => {
|
||||
const totals = { orderCount: 3, skuTypes: 3, expectedQuantity: 19, receivedQuantity: 14, remainingQuantity: 5, receivedBoxCount: 3, receivedParcelCount: 2, receivedPalletCount: 1 }
|
||||
vi.mocked(listLastMileOrders).mockResolvedValue({ records: [], page: 1, size: 10, total: 30, pages: 3 })
|
||||
|
||||
Reference in New Issue
Block a user