优化
This commit is contained in:
@@ -76,7 +76,7 @@ test('covers list detail create loading error empty pagination and actions-first
|
||||
assert.match(view, /key: 'actions', label: '操作', width: 90, fixed: 'left'/)
|
||||
assert.match(view, /class="business-table-card"/)
|
||||
assert.doesNotMatch(procurementView, /inventoryQuantity|outboundQuantity/)
|
||||
assert.match(procurementView, /label: '拒绝原因'/)
|
||||
assert.match(procurementView, /label: '失败 \/ 拒绝原因'/)
|
||||
assert.match(procurementView, /reviewRemark/)
|
||||
assert.match(procurementView, /procurementStatuses/)
|
||||
assert.match(procurementView, /ProcurementDetailPanel/)
|
||||
@@ -213,15 +213,9 @@ test('looseboard requires both times and rejects backwards schedule', () => {
|
||||
})
|
||||
|
||||
|
||||
test('truck creation waits for budget freeze and never submits after insufficient funds', async () => {
|
||||
let release
|
||||
const gate = new Promise(resolve => { release = resolve })
|
||||
const current = transportHarness('trucking', false, () => gate)
|
||||
test('truck creation does not block on a separate budget reservation', async () => {
|
||||
const current = transportHarness('trucking', false, async () => { throw new Error('旧冻结接口不应调用') })
|
||||
Object.assign(current.form, { vehicleType: 'PALLET_30', estimatedPalletCount: 3, budgetAmount: 100, origin: 'LA', destination: 'ONT', originContactName: 'A', originContactPhone: '1', destinationContactName: 'B', destinationContactPhone: '2', pickupAt: '2026-10-20T09:00:00', deliveryAt: '2026-10-20T15:00:00' })
|
||||
const pending = current.submit(); await Promise.resolve(); await Promise.resolve()
|
||||
assert.equal(current.calls.length, 0)
|
||||
release(); await pending; assert.equal(current.calls.length, 1)
|
||||
const failed = transportHarness('trucking', false, async () => { throw new Error('余额及授信不足') })
|
||||
Object.assign(failed.form, { ...current.form, vehicleType: 'PALLET_30', estimatedPalletCount: 3, budgetAmount: 100, origin: 'LA', destination: 'ONT', originContactName: 'A', originContactPhone: '1', destinationContactName: 'B', destinationContactPhone: '2', pickupAt: '2026-10-20T09:00:00', deliveryAt: '2026-10-20T15:00:00' })
|
||||
await failed.submit(); assert.equal(failed.calls.length, 0); assert.equal(failed.form.budgetAmount, 100)
|
||||
await current.submit()
|
||||
assert.equal(current.calls.length, 1)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user