This commit is contained in:
2026-09-15 15:24:59 +08:00
parent 90f97e846f
commit 5d2465d1ea
4 changed files with 215 additions and 15 deletions
@@ -28,6 +28,19 @@ describe('UnifiedOrdersView contract', () => {
expect(sendFeeSource).toContain("ElMessage.error(getApiErrorDetails(error, '确认费用发送失败').message)")
})
it('prevents duplicate confirm-and-send chains and reuses one attempt idempotency key set', () => {
const sendFeeSource = source.slice(source.indexOf('async function executeConfirmAndSendFee()'), source.indexOf('function handleOrderSelectionChange'))
expect(sendFeeSource).toContain('if (confirmFeeSending.value) return')
expect(sendFeeSource).toContain('const attempt = currentFeeConfirmAttempt(selectedWeightKg, selectedVolumeCbm, selectedUnitPrice)')
expect(sendFeeSource).toContain('attempt.calculateKey')
expect(sendFeeSource).toContain('attempt.adjustKey')
expect(sendFeeSource).toContain('attempt.confirmKey')
expect(sendFeeSource).toContain('attempt.sendKey')
expect(sendFeeSource).toContain("if (snapshot.feeStatus === 'SENT')")
expect(source).toContain('feeConfirmAttempt = null\n feeConfirmOpen.value = true')
})
it('exposes the product main statuses including dropship palletizing', () => {
expect(unifiedOrderStatusOptions.map((item) => item.label)).toEqual([
'待审核', '待测量数据', '待一件代发组托', '待分柜', '装柜中', '装柜完成', '派送完成',