优化
This commit is contained in:
@@ -55,4 +55,34 @@ describe('LastMileOrderDetailView domestic detail alignment', () => {
|
||||
if (index === 1) expect(panel.text()).toContain('SKU-001')
|
||||
}
|
||||
})
|
||||
|
||||
it('shows declared, received and highlighted signed difference only for warehouse transfers', async () => {
|
||||
vi.mocked(getLastMileOrder).mockResolvedValue({
|
||||
order: { id: 'transfer-id', customerId: 'customer-1', orderNo: 'WT-001', orderType: 'WAREHOUSE_TRANSFER', currentStatus: 'WAIT_CUSTOMER_CONFIRMATION', packageCount: 10, receivedPackageCount: 12, packageDifference: 2 },
|
||||
cargo: [], fees: [], statusHistory: [], operationHistory: [],
|
||||
})
|
||||
const wrapper = mount(LastMileOrderDetailView, { global: { plugins: [ElementPlus] } })
|
||||
await flushPromises()
|
||||
const fields = wrapper.get('dl[aria-label="基本信息"]')
|
||||
expect(fields.text()).toContain('客户预报箱数10')
|
||||
expect(fields.text()).toContain('实收箱数12')
|
||||
expect(fields.text()).toContain('箱数差异+2')
|
||||
expect(fields.get('.package-difference--nonzero').text()).toBe('+2')
|
||||
expect(wrapper.get('.status-badge').text()).toBe('入库测量中')
|
||||
const overview = wrapper.get('[aria-label="尾程订单概览"]')
|
||||
expect(overview.text()).toContain('实收总箱数12 箱')
|
||||
expect(overview.text()).not.toContain('客户预报总箱数')
|
||||
})
|
||||
|
||||
it('shows the declared total before a warehouse transfer has a received count', async () => {
|
||||
vi.mocked(getLastMileOrder).mockResolvedValue({
|
||||
order: { id: 'transfer-id', customerId: 'customer-1', orderNo: 'WT-002', orderType: 'WAREHOUSE_TRANSFER', currentStatus: 'WAIT_PDA_RECEIVING', packageCount: 10, receivedPackageCount: null, packageDifference: null },
|
||||
cargo: [], fees: [], statusHistory: [], operationHistory: [],
|
||||
})
|
||||
const wrapper = mount(LastMileOrderDetailView, { global: { plugins: [ElementPlus] } })
|
||||
await flushPromises()
|
||||
const overview = wrapper.get('[aria-label="尾程订单概览"]')
|
||||
expect(overview.text()).toContain('客户预报总箱数10 箱')
|
||||
expect(overview.text()).not.toContain('实收总箱数')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user