17 lines
952 B
JavaScript
17 lines
952 B
JavaScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { MODULES } from '../src/data/overseas-workbench.js'
|
|
|
|
test('only operations backed by a dedicated overseas PDA contract are enabled', () => {
|
|
const operations = MODULES.flatMap((module) => module.operations.map((operation) => ({ module: module.key, ...operation })))
|
|
const enabled = operations.filter((operation) => operation.available)
|
|
assert.deepEqual(enabled.map(({ module, name }) => ({ module, name })), [{ module: 'inbound', name: '拆柜收货' }])
|
|
|
|
const pendingNames = ['库存盘点', '商品移库', '托盘管理', '换标收货', '换标执行', '换标复核', '库存查询', '库位查询', '托盘查询']
|
|
for (const name of pendingNames) {
|
|
const operation = operations.find((item) => item.name === name)
|
|
assert.equal(operation?.available, false, `${name} must fail closed until its PDA API exists`)
|
|
assert.equal(operation?.badge, undefined)
|
|
}
|
|
})
|