优化
This commit is contained in:
@@ -5,14 +5,18 @@ import { readFile } from 'node:fs/promises'
|
||||
const read = (path) => readFile(new URL(path, import.meta.url), 'utf8')
|
||||
|
||||
test('overseas PDA is an independent Vue 3 app with separate packaging identity', async () => {
|
||||
const [manifest, pages, pkg] = await Promise.all([
|
||||
read('../src/manifest.json'), read('../src/pages.json'), read('../package.json')
|
||||
const [manifest, pages, pkg, vite] = await Promise.all([
|
||||
read('../src/manifest.json'), read('../src/pages.json'), read('../package.json'), read('../vite.config.js')
|
||||
])
|
||||
assert.match(manifest, /"name"\s*:\s*"柏悦物流\s*PDA\s*海外版"/)
|
||||
assert.match(manifest, /"packagename"\s*:\s*"com\.baiyuelogistics\.pda\.overseas"/)
|
||||
assert.match(manifest, /"vueVersion"\s*:\s*"3"/)
|
||||
assert.doesNotMatch(pages, /pages\/picking|pages\/tasks/)
|
||||
assert.match(pkg, /"build:app"\s*:\s*"uni build -p app"/)
|
||||
assert.match(vite, /API_PROXY_TARGET/)
|
||||
assert.match(vite, /OVERSEAS_API_PROXY_TARGET/)
|
||||
assert.match(vite, /\/overseas-api/)
|
||||
assert.match(vite, /replace\(\/\^\\\/overseas-api\//)
|
||||
})
|
||||
|
||||
test('overseas workbench contains only confirmed inbound and in-warehouse domains', async () => {
|
||||
@@ -34,6 +38,9 @@ test('login has no committed demo credentials and inbound operation implements t
|
||||
assert.doesNotMatch(login, /ChangeMe|platform_admin/)
|
||||
assert.match(login, /DEV_LOGIN\.username|DEV_LOGIN\.password/)
|
||||
assert.match(runtime, /runtimeEnvironment\.DEV|VITE_PDA_DEV_USERNAME|VITE_PDA_DEV_PASSWORD/)
|
||||
assert.match(runtime, /'\/overseas-api'/)
|
||||
assert.match(runtime, /#ifdef H5[\s\S]*?VITE_H5_AUTH_API_BASE_URL/)
|
||||
assert.match(runtime, /#ifdef H5[\s\S]*?VITE_H5_OVERSEAS_API_BASE_URL/)
|
||||
assert.match(operation, /startScanBroadcast/)
|
||||
for (const action of ['prepareReceivingContainer', 'getCurrentReceiving', 'resolveCurrentSku', 'resolveCurrentCarton', 'resolveCurrentPallet', 'receiveCurrentBulk', 'receiveCurrentCarton', 'completeCurrentReceiving']) assert.match(operation, new RegExp(action))
|
||||
for (const path of ['/candidates', '/prepare', '/unload-photos/files', '/sign', '/skus/resolve', '/cartons/resolve', '/pallets/resolve', '/receipts/bulk', '/receipts/carton', '/complete']) assert.match(inbound, new RegExp(path.replaceAll('/', '\\/')))
|
||||
|
||||
@@ -3,12 +3,14 @@ import assert from 'node:assert/strict'
|
||||
import { isNoCurrentReceiving, isReceivingConflict, normalizeReceivingCandidate, normalizeReceivingSession, RECEIVING_PHOTO_ROLES } from '../src/api/receiving-adapter.js'
|
||||
|
||||
test('receiving adapter preserves the three signed photo roles in workflow order', () => {
|
||||
const snowflakeFileId = '2092476334483931138'
|
||||
const session = normalizeReceivingSession({
|
||||
status: 'WAIT_SIGN', totalPackages: 8, receivedPackages: 2, pendingPackages: 6,
|
||||
photos: [{ role: 'DOOR_OPEN', fileId: 3 }, { role: 'LICENSE_PLATE', fileId: 1 }, { role: 'CONTAINER_SEAL', fileId: 2 }],
|
||||
photos: [{ role: 'DOOR_OPEN', fileId: '3' }, { role: 'LICENSE_PLATE', fileId: snowflakeFileId }, { role: 'CONTAINER_SEAL', fileId: '2' }],
|
||||
inbounds: [{ inboundCode: 'IN-1', plannedPalletCount: 2, totalPackages: 8, receivedPackages: 2, pendingPackages: 6 }]
|
||||
})
|
||||
assert.deepEqual(session.photos.map(({ role }) => role), RECEIVING_PHOTO_ROLES)
|
||||
assert.equal(session.photos[0].fileId, snowflakeFileId)
|
||||
assert.equal(session.inbounds[0].plannedPalletCount, 2)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user