This commit is contained in:
2026-09-11 18:44:04 +08:00
parent 35f245d067
commit c69e9411c7
6 changed files with 65 additions and 26 deletions
+9
View File
@@ -7,6 +7,15 @@ const state = await import(`data:text/javascript;base64,${Buffer.from(source).to
const items = [{ id: 1 }, { id: 2 }, { id: 3 }]
test('inventory resources expose distinct locations and total available cartons', () => {
assert.deepEqual(state.summarizeInventoryResources([
{ locationCode: 'A0', availablePackageCount: 4 },
{ locationCode: 'A0', availablePackageCount: 2 },
{ locationCode: 'B-03', availablePackageCount: 1 },
]), { location: 'A0、B-03', availablePackageCount: 7 })
assert.deepEqual(state.summarizeInventoryResources(null), { location: '', availablePackageCount: null })
})
test('createItemStates initializes every item as pending', () => {
assert.deepEqual(state.createItemStates(items), {
1: state.ITEM_STATUS.PENDING,