test: align wallet ledger assertions with contract
This commit is contained in:
+3
@@ -23,6 +23,9 @@ test('钱包闭环覆盖充值、授信、采购冻结结算和换标结算释
|
||||
"['VOUCHER', 'RECEIPT']",
|
||||
"walletStatus === 'FROZEN'",
|
||||
"walletStatus === 'SETTLED'",
|
||||
"['FREEZE_PENDING', 'FROZEN']",
|
||||
"['FREEZE', 'CONSUMPTION', 'UNFREEZE']",
|
||||
'item.sourceNo === businessNo',
|
||||
"'RELEASED'",
|
||||
"terminalStatus === 'COMPLETED'",
|
||||
"'CANCELLED'",
|
||||
|
||||
@@ -142,7 +142,7 @@ async function procurementFlow(context, fixture, overseasToken) {
|
||||
})
|
||||
const feeNo = fee?.body?.data?.feeNo
|
||||
assert(context, '采购费用创建并开始钱包冻结', fee,
|
||||
success(fee) && Boolean(feeNo) && ['PENDING', 'FROZEN'].includes(fee.body.data?.walletStatus),
|
||||
success(fee) && Boolean(feeNo) && ['FREEZE_PENDING', 'FROZEN'].includes(fee.body.data?.walletStatus),
|
||||
`feeNo=${feeNo || 'missing'}, walletStatus=${fee.body?.data?.walletStatus || 'missing'}`)
|
||||
if (!success(fee) || !feeNo) return null
|
||||
|
||||
@@ -229,8 +229,8 @@ async function verifyClientWallet(context, token, fixture, wallet, procurement,
|
||||
const businessNos = [procurement.feeNo, ...relabels.map((item) => item.relabelNo)]
|
||||
assert(context, '客户账本包含充值、冻结、结算和释放明细', ledger,
|
||||
success(ledger) && entries.some((item) => item.changeType === 'RECHARGE')
|
||||
&& businessNos.every((businessNo) => entries.some((item) => item.businessNo === businessNo))
|
||||
&& ['FREEZE', 'SETTLE', 'RELEASE'].every((type) => entries.some((item) => item.changeType === type)),
|
||||
&& businessNos.every((businessNo) => entries.some((item) => item.sourceNo === businessNo))
|
||||
&& ['FREEZE', 'CONSUMPTION', 'UNFREEZE'].every((type) => entries.some((item) => item.changeType === type)),
|
||||
`entries=${entries.length}, businessNos=${businessNos.join(',')}`)
|
||||
return account?.body?.data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user