feat(pda): persist and batch cabinet picking
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
|
||||
const source = await readFile(new URL('../stores/picking.js', import.meta.url), 'utf8')
|
||||
|
||||
test('picking drafts are persisted under operator, task and cabinet identity', () => {
|
||||
assert.match(source, /pda-picking-draft/)
|
||||
assert.match(source, /operatorId/)
|
||||
assert.match(source, /taskId/)
|
||||
assert.match(source, /containerNo/)
|
||||
assert.match(source, /uni\.setStorageSync\(key/)
|
||||
assert.match(source, /uni\.getStorageSync\(key/)
|
||||
assert.match(source, /uni\.removeStorageSync\(key/)
|
||||
})
|
||||
|
||||
test('draft restore rejects a different operator or task', () => {
|
||||
assert.match(source, /saved\.operatorId !== identityValue\(identity\)\.operatorId/)
|
||||
assert.match(source, /saved\.taskId !== identityValue\(identity\)\.taskId/)
|
||||
assert.match(source, /saved\.containerNo !== identityValue\(identity\)\.containerNo/)
|
||||
})
|
||||
Reference in New Issue
Block a user