This commit is contained in:
2026-10-21 15:10:44 +08:00
parent 40a03978cd
commit 6fe632f28e
34 changed files with 372 additions and 110 deletions
@@ -152,8 +152,7 @@ function fixture(options = {}) {
const replay = state.looseboardStatuses.get(body.idempotencyKey)
if (replay) return replay.hash === hash ? response(replay.result) : response(null, 'A0409')
if (Number(body.version) !== state.looseboard.version) return response(null, 'A0409')
const allowed = (state.looseboard.status === 'PENDING_ACCEPTANCE' && ['DISPATCHED', 'CANCELLED'].includes(body.status))
|| (state.looseboard.status === 'DISPATCHED' && body.status === 'CANCELLED')
const allowed = state.looseboard.status === 'PENDING_ACCEPTANCE' && body.status === 'CANCELLED'
if (!allowed) return response(null, 'A0409')
const from = state.looseboard.status
state.looseboard = { ...state.looseboard, status: body.status, version: state.looseboard.version + 1 }
@@ -162,6 +161,7 @@ function fixture(options = {}) {
state.looseboardStatuses.set(body.idempotencyKey, { hash, result })
return response(result)
}
if (requestPath.includes('/pending-looseboard-demands?') && method === 'GET') return response(page([state.looseboard]))
if (requestPath.includes('/local-looseboard-orders/LB1?') && method === 'GET') return response(looseboardDetail())
if (requestPath.includes('/local-looseboard-orders/LB1?') && method === 'PUT') {
if (Number(body.version) !== state.looseboard.version) return response(null, 'A0409')
@@ -222,7 +222,8 @@ test('procurement creation review boundaries and transport cancellation paths pa
await run(context)
assert.equal(context.steps.every((step) => step.passed), true,
context.steps.filter((step) => !step.passed).map((step) => `${step.name}: ${step.evidence}`).join('\n'))
assert.equal(context.gaps.length, 0)
assert.equal(context.gaps.length, 1)
assert.equal(context.gaps[0][1], 'looseboard-pool-fulfillment')
assert.equal(context.blockers.length, 0)
assert.equal(context.calls.filter(call => call.path === '/api/auth/login').length, 1)
assert.equal(context.calls.filter(call => call.path === '/api/auth/logout').length, 1)