fix(overseas-pda): stabilize receiving state flow

This commit is contained in:
2026-08-27 15:56:13 +08:00
parent 7624f83d1e
commit 3fdfcb659a
5 changed files with 26 additions and 10 deletions
+7
View File
@@ -65,6 +65,13 @@ test('login has no committed demo credentials and inbound operation implements t
for (const role of ['LICENSE_PLATE', 'CONTAINER_SEAL', 'DOOR_OPEN']) assert.match(adapter, new RegExp(role))
for (const forbidden of ['customerId', 'planNo', 'allocationId', 'warehouseId', 'locationId']) assert.doesNotMatch(inbound, new RegExp(forbidden))
assert.match(operation, /isReceivingConflict|recoverCurrentAfterConflict/)
assert.match(operation, /onShow\(\)[\s\S]*this\.phase === 'candidates'[\s\S]*this\.bootstrap\(\)/)
assert.match(operation, /candidateLoading[\s\S]*candidateError/)
assert.match(operation, /candidateError\.requestId[\s\S]*candidateError\.traceId/)
assert.match(operation, /@tap="loadCandidates"[^>]*>重新加载/)
assert.match(operation, /async loadCandidates\(feedback = true\)[\s\S]*if \(this\.candidateLoading\) return[\s\S]*this\.candidateError = error/)
assert.match(operation, /async prepareContainer\(\)[\s\S]*this\.busy\) return/)
assert.match(operation, /prepareReceivingContainer[\s\S]*releaseIdempotencyKey\(key\.signature\)/)
assert.match(overseas, /replaceTokens|refreshOverseasToken/)
assert.match(overseas, /requestId/)
})
+5 -1
View File
@@ -16,7 +16,11 @@ test('receiving adapter preserves the three signed photo roles in workflow order
})
test('receiving adapter exposes calculable candidate facts and workflow errors', () => {
const candidate = normalizeReceivingCandidate({ destinationCodes: ['ONT8', 'LAX'], plannedPalletCount: 4, currentAccount: true })
const candidate = normalizeReceivingCandidate({ containerNo: ' C10000000 ', status: 'WAIT_SIGN', planCount: 15, inboundCodeCount: 15, destinationCodes: ['ONT8', 'LAX'], plannedPalletCount: 4, currentAccount: true })
assert.equal(candidate.containerNo, 'C10000000')
assert.equal(candidate.status, 'WAIT_SIGN')
assert.equal(candidate.planCount, 15)
assert.equal(candidate.inboundCodeCount, 15)
assert.deepEqual(candidate.destinationCodes, ['ONT8', 'LAX'])
assert.equal(candidate.plannedPalletCount, 4)
assert.equal(candidate.currentAccount, true)
+2 -2
View File
@@ -65,8 +65,8 @@ test('camera replaces only one fixed slot and failed retake preserves its previo
assert.match(page, /\.photo-grid\{display:grid;grid-template-columns:1fr/)
assert.match(page, /grid-template-columns:82px minmax\(0,1fr\) 78px/)
assert.match(page, /class="photo-role-info"/)
assert.match(page, /onShow\(\)[\s\S]*this\.inboundMode && !this\.bootstrapped[\s\S]*this\.bootstrap\(\)/)
assert.match(page, /await this\.applyCurrentReceiving\(current\); this\.bootstrapped = true/)
assert.match(page, /onShow\(\)[\s\S]*this\.inboundMode && \(!this\.bootstrapped \|\| this\.phase === 'candidates'\)[\s\S]*this\.bootstrap\(\)/)
assert.match(page, /await this\.applyCurrentReceiving\(current\);[\s\S]*this\.bootstrapped = true/)
})
test('local thumbnail, preview, and authenticated session restore are wired to the frozen contract', () => {