优化
This commit is contained in:
@@ -15,6 +15,16 @@ vi.mock('../api/warehouseTransfers', () => ({ getWarehouseTransfer: vi.fn() }))
|
||||
enableAutoUnmount(afterEach)
|
||||
|
||||
describe('LastMileOrderDetailView domestic detail alignment', () => {
|
||||
it('counts mixed parcel and box receipts by their physical unit instead of calling both parcels', async () => {
|
||||
vi.mocked(getLastMileOrder).mockResolvedValue({ order: { id: 'return-tail', customerId: 'C1', orderType: 'RETURN_RELABEL', orderNo: 'RT-1' }, cargo: [], fees: [], statusHistory: [], operationHistory: [],
|
||||
returnReceipt: { order: { returnNo: 'RT-1', expectedQuantity: 8, receivedQuantity: 8 }, receipts: [{ receiptNo: 'P1', unitType: 'PARCEL' }, { receiptNo: 'B1', unitType: 'BOX', length: 30, width: 20, height: 10, weight: 2 }],
|
||||
cartons: [{ receiptNo: 'P1', cartonMark: 'PK1', items: [] }, { receiptNo: 'B1', cartonMark: 'RC1', items: [] }] } })
|
||||
const wrapper = mount(LastMileOrderDetailView, { global: { plugins: [ElementPlus] } }); await flushPromises()
|
||||
await wrapper.get('#tab-return-receipt').trigger('click'); await flushPromises()
|
||||
expect(wrapper.text()).toContain('签收实物明细(1 包裹 · 1 箱)')
|
||||
expect(wrapper.text()).not.toContain('2 包裹')
|
||||
expect(wrapper.text()).toContain('长 30 cm · 宽 20 cm · 高 10 cm · 体积 0.006 m³ · 重量 2 kg')
|
||||
})
|
||||
it.each(['PENDING_REVIEW', 'PARTIALLY_RECEIVED', 'COMPLETED'])('shows only customer SKU forecast regardless of receipt status (%s)', async status => {
|
||||
vi.mocked(getLastMileOrder).mockResolvedValue({ order: { id: 'return-tail', customerId: 'C1', orderType: 'RETURN_RELABEL', orderNo: 'RT-1', currentStatus: status, packageCount: 30 },
|
||||
cargo: [], fees: [], statusHistory: [], operationHistory: [],
|
||||
|
||||
Reference in New Issue
Block a user