20 lines
721 B
TypeScript
20 lines
721 B
TypeScript
import assert from 'node:assert/strict'
|
|
import { readFile } from 'node:fs/promises'
|
|
import test from 'node:test'
|
|
|
|
test('价格历史入口只在 hasPaymentAmountHistory 为真时显示,并调用专用接口', async () => {
|
|
const cell = await readFile(
|
|
new URL('../src/pages/admin/panels/WorkOrderTableCells.tsx', import.meta.url),
|
|
'utf8',
|
|
)
|
|
assert.ok(cell.includes('order.hasPaymentAmountHistory ?'))
|
|
assert.ok(cell.includes('fetchAdminWorkOrderPaymentAmountHistory'))
|
|
assert.ok(cell.includes('价格历史记录'))
|
|
|
|
const service = await readFile(
|
|
new URL('../src/services/admin/worker-platform.ts', import.meta.url),
|
|
'utf8',
|
|
)
|
|
assert.ok(service.includes('/payment-amount-history'))
|
|
})
|