test(acceptance): reuse fixed customers and align native fulfillment flows

This commit is contained in:
2026-10-23 04:48:02 +08:00
parent b92f7fe991
commit 139f6b1932
51 changed files with 1076 additions and 228 deletions
@@ -66,7 +66,7 @@ function authority({ failSave = false, mutateOrder = false, unknown = 0, drift =
if (pathname.endsWith('/orders/order1')) return response(state.order)
if (pathname.endsWith('/cargo-verification')) {
if (method === 'GET') {
const allocated = state.appointments.filter(a => a.appointmentStatus === 'PENDING' && !a.replacementBatchKeys.length)
const allocated = state.appointments.filter(a => !a.replacementBatchKeys.length)
.flatMap(a => a.items).reduce((n, i) => n + i.packageCount, 0)
return response({ source: sourceFacts, verification: state.verification, allocatedPackages: String(allocated),
availablePackages: String((state.verification?.packageCount ?? packages) - allocated), unknownAllocationCount: String(unknown), sourceChanged: drift })
@@ -123,7 +123,7 @@ test('four real boxes retain original order facts through verification, cancel,
assert.equal(state.order.order.packageCount, 4)
assert.equal(state.order.order.version, 7)
assert.deepEqual(state.verification, { version: 2, sourceVersion: 'source-v1', packageCount: 4 })
assert.equal(state.appointments.length, 5)
assert.equal(state.appointments.length, 4)
assert.equal(state.history.size, 1)
assert.equal(state.history.get(result.cancelledAppointmentNo).length, 1)
assert.equal(result.replacedBatchKeys.length, 3)