This commit is contained in:
2026-08-19 16:45:51 +08:00
parent d1de19dc82
commit 65cd9ecefa
79 changed files with 3397 additions and 38 deletions
+5 -4
View File
@@ -6,7 +6,7 @@ function source(path: string) {
return readFileSync(resolve(process.cwd(), path), 'utf8')
}
describe('finance five-page delivery contract', () => {
describe('finance six-page delivery contract', () => {
const routes = source('src/modules/finance/routes.ts')
const navigation = source('src/core/navigation/adminNavigation.ts')
const api = source('src/modules/finance/api/finance.ts')
@@ -14,19 +14,20 @@ describe('finance five-page delivery contract', () => {
const pages = [
['finance/customer-accounts', '客户账户'],
['finance/customer-arap', '客户应收应付'],
['finance/receivable-statistics', '应收款统计表'],
['finance/customer-statements', '客户对账单'],
['finance/settlement-receivables', '结算单应收'],
['finance/settlement-payables', '结算单应付'],
] as const
it('registers the five menu routes plus hidden detail routes', () => {
it('registers the six menu routes plus hidden detail routes', () => {
for (const [path, title] of pages) {
expect(routes).toContain(`path: '${path}'`)
expect(routes).toContain(`title: '${title}'`)
expect(navigation).toContain(`path: '/${path}'`)
expect(navigation).toContain(`title: '${title}'`)
}
expect(navigation.match(/path: '\/finance\//g)).toHaveLength(5)
expect(navigation.match(/path: '\/finance\//g)).toHaveLength(6)
expect(routes.match(/path: 'finance\/customer-accounts\/:customerId'/g)).toHaveLength(1)
expect(routes.match(/path: 'finance\/customer-arap\/:feeSourceId'/g)).toHaveLength(1)
expect(navigation).not.toContain('/finance/customer-accounts/:customerId')
@@ -41,7 +42,7 @@ describe('finance five-page delivery contract', () => {
})
it('keeps production reads on fixed DTO endpoints only', () => {
for (const endpoint of ['customer-accounts', 'fee-pool', 'statements', 'receivable-settlements', 'payable-settlements']) {
for (const endpoint of ['customer-accounts', 'fee-pool', 'receivable-statistics', 'statements', 'receivable-settlements', 'payable-settlements']) {
expect(api).toContain(`${basePathMarker(endpoint)}`)
}
expect(api).not.toContain('function listFinanceBills')