fix(pl): 证书齐备待完善归档不再误出齐备按钮。
归档结转无用量行时保留待完善错误文案,前端按计划齐备状态只提醒完善证件。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
95ecb7236e
commit
02d576abfe
7 files changed
+146
-9
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
import { resolveArchiveQuotaBlockMode } from '../src/utils/pl-archive-quota-block'
|
||||
|
||||
test('pending fulfill plan only alerts, no certificate-ready confirm', () => {
|
||||
assert.equal(
|
||||
resolveArchiveQuotaBlockMode(
|
||||
'实际数量已保存,证件没有扣减。请把实际数量改小,或先补充购买证和运输证,再重新归档。',
|
||||
'用证没有完成',
|
||||
{ quotaCertPendingFulfill: 1, quotaCertWaived: 1 }
|
||||
),
|
||||
'alert-pending'
|
||||
)
|
||||
})
|
||||
|
||||
test('already waived plan does not offer archive-time certificate ready', () => {
|
||||
assert.equal(
|
||||
resolveArchiveQuotaBlockMode('余额不足', '用证没有完成', { quotaCertWaived: 1 }),
|
||||
'alert-pending'
|
||||
)
|
||||
})
|
||||
|
||||
test('pending keywords still force alert mode without plan flags', () => {
|
||||
assert.equal(
|
||||
resolveArchiveQuotaBlockMode(
|
||||
'该计划仍处于证书齐备待完善,请先在证书齐备中完善并关闭后再归档',
|
||||
'用证没有完成',
|
||||
{}
|
||||
),
|
||||
'alert-pending'
|
||||
)
|
||||
})
|
||||
|
||||
test('unmarked legacy quota block still offers certificate ready', () => {
|
||||
assert.equal(
|
||||
resolveArchiveQuotaBlockMode(
|
||||
'实际数量已保存,证件没有扣减。请把实际数量改小,或先补充购买证和运输证,再重新归档。',
|
||||
'用证没有完成',
|
||||
{ quotaCertPendingFulfill: 0, quotaCertWaived: 0 }
|
||||
),
|
||||
'confirm-ready'
|
||||
)
|
||||
})
|
||||
|
||||
test('non quota-title blocks stay plain alert', () => {
|
||||
assert.equal(resolveArchiveQuotaBlockMode('不能归档:缺证', '不能归档', {}), 'alert-plain')
|
||||
})
|
||||
Reference in new issue
Block a user