This commit is contained in:
2026-11-03 11:44:04 +08:00
parent 8857faf457
commit bab96743d7
5 changed files with 23 additions and 10 deletions
+10
View File
@@ -5,6 +5,15 @@ import vm from 'node:vm'
const physicalRow = items => ({ items, length: 10, width: 10, height: 10, weight: 1, originalPackaging: true, confirmed: true })
test('physical volume uses cubic metres while receipt dimensions remain centimetres', () => {
const page = setup(async () => ({}))
assert.equal(page.rowVolume({ length: 30, width: 20, height: 20 }), '0.012000')
assert.equal(page.rowVolume({ length: 1, width: 1, height: 1 }), '0.000001')
assert.equal(page.rowVolume({ length: '', width: 20, height: 20 }), '—')
page.palletLength = 120; page.palletWidth = 100; page.palletHeight = 150
assert.equal(page.palletVolume, '1.800000')
})
test('box and parcel confirmation opens the camera only after every valid row is confirmed', () => {
for (const type of ['BOX', 'PARCEL']) {
const cameras = []
@@ -129,6 +138,7 @@ function setup(confirm, saved = new Map(), scope = 'operator:warehouse', runtime
quantity: () => 2, boxCount: () => 1
})
Object.defineProperty(instance, 'allBoxRowsConfirmed', { get: () => component.computed.allBoxRowsConfirmed.call(instance) })
Object.defineProperty(instance, 'palletVolume', { get: () => component.computed.palletVolume.call(instance) })
return instance
}