Files
shanxia2.0/web-admin/scripts/quota-usage-mobile.test.ts
T
wuzilongandCursor 8e9536332a feat: 保存运输证件、报销付款和开发流程的当前实现。
补齐证书齐备、证件折算、移动用证和合同绑定,并带上报销批量发放、付款备注以及个人开发流程升级,便于继续讨论已安排计划的调整规则。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-04 21:42:33 +08:00

39 lines
1.3 KiB
TypeScript

import assert from 'node:assert/strict'
import test from 'node:test'
import type { CertificateStatistics } from '../src/api/pl/quota-cert'
import { certListStatus, linkLabel, scopeStatusLabel, usageTrackingRows } from '../src/views/m/pl/plan-cert/usage-model'
test('certificate usage rows keep the contract number, model, party and address from the web detail', () => {
const detail = {
contracts: [
{
id: 'contract',
contractNo: 'SX-1',
products: [{ contractProductId: 'product', model: '98%' }]
}
],
usageItems: [
{
id: 'line',
contractId: 'contract',
contractProductId: 'product',
planNo: 'PO-1',
stopType: 'delivery',
productName: '硫酸',
partyName: '送货方',
address: '仓库',
itemStatus: 'settled'
}
]
} as CertificateStatistics
const [row] = usageTrackingRows(detail)
assert.equal(row.contractNo, 'SX-1')
assert.equal(row.productModel, '98%')
assert.equal(row.partyName, '送货方')
assert.equal(row.address, '仓库')
assert.equal(certListStatus(row.itemStatus), '已核销')
assert.equal(linkLabel('active'), '可安排用证')
assert.equal(linkLabel('inactive'), '停止新增使用')
assert.equal(scopeStatusLabel(null), '历史解绑')
})