优化
This commit is contained in:
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import test from 'node:test'
|
||||
|
||||
import { cleanupSucceeded } from './fee-items.mjs'
|
||||
import { cleanupSucceeded, isAcceptanceFeeItem } from './fee-items.mjs'
|
||||
|
||||
const source = readFileSync(new URL('./fee-items.mjs', import.meta.url), 'utf8')
|
||||
|
||||
@@ -20,3 +20,14 @@ test('cleanup treats successful deletion and an already absent resource as clean
|
||||
assert.equal(cleanupSucceeded({ http: 404, body: {} }), true)
|
||||
assert.equal(cleanupSucceeded({ http: 200, body: { code: 'A0422' } }), false)
|
||||
})
|
||||
|
||||
test('stale cleanup only recognizes the acceptance-owned code and name pair', () => {
|
||||
assert.equal(isAcceptanceFeeItem({ feeCode: 'ACPT_813083345572', feeTypeName: '全量验收费用-813083345572-已编辑' }), true)
|
||||
assert.equal(isAcceptanceFeeItem({ feeCode: 'FEE_TYPE_001', feeTypeName: '全量验收费用-001' }), false)
|
||||
assert.equal(isAcceptanceFeeItem({ feeCode: 'ACPT_813083345572', feeTypeName: '正式费用项目' }), false)
|
||||
})
|
||||
|
||||
test('baseline checks run only after stale acceptance cleanup', () => {
|
||||
assert.ok(source.indexOf('cleanupStaleAcceptanceItems(context)')
|
||||
< source.indexOf("'分页总数110且默认20条对应6页'"))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user