优化
This commit is contained in:
@@ -30,6 +30,19 @@ function fixture(): WarehouseTransferDetailDto {
|
||||
beforeEach(() => { vi.mocked(getWarehouseTransfer).mockReset(); vi.mocked(getWarehouseTransferCartonLabel).mockReset() })
|
||||
afterEach(() => vi.restoreAllMocks())
|
||||
describe('转运预报与实际签收明细', () => {
|
||||
it('keeps historical receipt totals after discard or shipment and leaves unknown declaration differences blank', async () => {
|
||||
const value = fixture()
|
||||
value.items[0]!.quantity = null
|
||||
value.cartons[0]!.status = 'DISCARD_PENDING'
|
||||
value.cartons[1]!.status = 'SHIPPED'
|
||||
value.cartons[2]!.status = 'DISCARDED'
|
||||
vi.mocked(getWarehouseTransfer).mockResolvedValue(value)
|
||||
const wrapper = render(); await flushPromises()
|
||||
expect(wrapper.emitted('summary')!.at(-1)![0]).toMatchObject({ boxes: 3, quantity: 27, skus: 2, forecastQuantity: null })
|
||||
const rows = wrapper.findAllComponents(DataTableStub)[0]!.props('data')
|
||||
expect(rows[0]).toMatchObject({ receivedQuantity: 20, receivedBoxes: 2, quantityDifference: null })
|
||||
expect(wrapper.findAll('.test-table')[0]!.text()).toContain('未记录')
|
||||
})
|
||||
it('shows every SKU in a mixed box and counts its physical measurements once', async () => {
|
||||
const value = fixture()
|
||||
value.cartons = [{ ...value.cartons[0]!, quantity: 10, items: [{ transferItemId: '10', skuCode: 'SKU-A', quantity: 3 }, { transferItemId: '20', skuCode: 'SKU-B', quantity: 7 }] }]
|
||||
|
||||
Reference in New Issue
Block a user