优化
This commit is contained in:
@@ -13,7 +13,7 @@ vi.mock('../api/warehouseTransfers', () => ({ getWarehouseTransfer: vi.fn() }))
|
||||
enableAutoUnmount(afterEach)
|
||||
|
||||
describe('LastMileOrderDetailView domestic detail alignment', () => {
|
||||
it.each(['PENDING_REVIEW', 'PARTIALLY_RECEIVED'])('shows SKU forecast before receipt completion (%s) without forecast box counts', async status => {
|
||||
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: [],
|
||||
returnReceipt: { order: { returnNo: 'RT-1', status, expectedQuantity: 30, receivedQuantity: 5 }, receipts: [],
|
||||
@@ -28,15 +28,16 @@ describe('LastMileOrderDetailView domestic detail alignment', () => {
|
||||
expect(panel.text()).toContain('30')
|
||||
expect(panel.text()).not.toContain('箱数')
|
||||
})
|
||||
it('uses actual cargo after return receipt completion', async () => {
|
||||
it('keeps customer forecast after completion instead of using actual signed cargo', async () => {
|
||||
vi.mocked(getLastMileOrder).mockResolvedValue({ order: { id: 'return-tail', customerId: 'C1', orderType: 'RETURN_RELABEL', orderNo: 'RT-1', currentStatus: 'INBOUND_COMPLETED' },
|
||||
cargo: [{ id: 'actual', skuCode: 'SKU-ACTUAL', productNameZh: '实收商品', productQuantity: 25, packageCount: 2 }], fees: [], statusHistory: [], operationHistory: [],
|
||||
returnReceipt: { order: { returnNo: 'RT-1', status: 'COMPLETED', expectedQuantity: 30, receivedQuantity: 25 }, receipts: [], items: [{ skuCode: 'SKU-FORECAST', expectedQuantity: 30, receivedQuantity: 25 }] } })
|
||||
const wrapper = mount(LastMileOrderDetailView, { global: { plugins: [ElementPlus] } }); await flushPromises()
|
||||
await wrapper.findAll('[role="tab"]').find(tab => tab.text().includes('货物信息'))!.trigger('click'); await flushPromises()
|
||||
expect(wrapper.get('.table-panel').text()).toContain('SKU-ACTUAL')
|
||||
expect(wrapper.get('.table-panel').text()).not.toContain('SKU-FORECAST')
|
||||
expect(wrapper.get('.table-panel').text()).toContain('25')
|
||||
expect(wrapper.get('.table-panel').text()).not.toContain('SKU-ACTUAL')
|
||||
expect(wrapper.get('.table-panel').text()).toContain('SKU-FORECAST')
|
||||
expect(wrapper.get('.table-panel').text()).toContain('30')
|
||||
expect(wrapper.get('.table-panel').text()).not.toContain('箱数')
|
||||
})
|
||||
it('shows signed box contents and actual quantities on return orders', async () => {
|
||||
vi.mocked(getLastMileOrder).mockResolvedValue({ order: { id: 'tail-return', customerId: 'customer-1', orderNo: 'RETU-1', orderType: 'RETURN_RELABEL', currentStatus: 'INBOUND_COMPLETED' }, cargo: [], fees: [], statusHistory: [], operationHistory: [],
|
||||
|
||||
Reference in New Issue
Block a user