test: provision finance fixture prerequisites
This commit is contained in:
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { buildContainerCostBody, normalizeFinanceFixtureSources, run,
|
||||
import { buildContainerCostBody, buildSupplierBody, normalizeFinanceFixtureSources, run,
|
||||
supplierCategoryForFeeItem } from './finance-full-fixtures.mjs'
|
||||
|
||||
const here = path.dirname(fileURLToPath(import.meta.url))
|
||||
@@ -40,6 +40,16 @@ test('PAYABLE fee selection requires the formal flag and a Finance-supported sup
|
||||
assert.equal(supplierCategoryForFeeItem({ feeCode: 'UNSUPPORTED', feeName: '操作费' }), null)
|
||||
})
|
||||
|
||||
test('Finance PAYABLE fixture creates an isolated ACTIVE supplier through the formal API', () => {
|
||||
const body = buildSupplierBody('ADMIN-API-20260815-FINANCE', 'BOOKING')
|
||||
assert.equal(body.category, 'BOOKING')
|
||||
assert.equal(body.scope, 'DOMESTIC')
|
||||
assert.equal(body.status, 'ACTIVE')
|
||||
assert.match(body.name, /^财务验收供应商-/)
|
||||
assert.match(source, /POST', '\/api\/platform\/v1\/suppliers\?tenantId=0'/)
|
||||
assert.match(source, /detail\?\.status === 'ACTIVE' && detail\?\.category === category/)
|
||||
})
|
||||
|
||||
test('automatic fee fixture completes the reviewed pricing workflow without recalculating', () => {
|
||||
assert.match(source, /latest\?\.feeId/)
|
||||
assert.doesNotMatch(source, /latest\?\.id/)
|
||||
|
||||
Reference in New Issue
Block a user