优化
This commit is contained in:
@@ -69,25 +69,25 @@ test('submitStates turns only pending items into skipped', () => {
|
||||
})
|
||||
})
|
||||
|
||||
test('classifyScan distinguishes pending, repeated, and unknown SKU codes', () => {
|
||||
const scanItems = [{ id: 1, sku: 'EL-38201' }, { id: 2, sku: 'EL-38202' }]
|
||||
test('classifyScan distinguishes pending, repeated, and unknown carton codes', () => {
|
||||
const scanItems = [{ id: 1, boxCodes: ['BOX-001'] }, { id: 2, boxCodes: ['BOX-002', 'BOX-003'] }]
|
||||
|
||||
assert.deepEqual(state.classifyScan(scanItems, {
|
||||
1: state.ITEM_STATUS.PICKED,
|
||||
2: state.ITEM_STATUS.PENDING,
|
||||
}, 'EL-38202'), {
|
||||
}, 'BOX-002'), {
|
||||
type: 'pending',
|
||||
item: scanItems[1],
|
||||
})
|
||||
assert.deepEqual(state.classifyScan(scanItems, {
|
||||
1: state.ITEM_STATUS.PARTIAL,
|
||||
2: state.ITEM_STATUS.PENDING,
|
||||
}, 'EL-38201'), {
|
||||
}, 'BOX-001', { 'BOX-001': 1 }), {
|
||||
type: 'processed',
|
||||
item: scanItems[0],
|
||||
status: state.ITEM_STATUS.PARTIAL,
|
||||
})
|
||||
assert.deepEqual(state.classifyScan(scanItems, {}, 'NO-SUCH-SKU'), {
|
||||
assert.deepEqual(state.classifyScan(scanItems, {}, 'NO-SUCH-BOX'), {
|
||||
type: 'unknown',
|
||||
item: null,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user