Files
ssw-mvp/docs/e2e/cases/TC-CONTRACT-021.mjs
T
admin 3247e9fd15 init: ssw-mvp initial commit
- boot/ (Java/Maven, JNPF 7.0) — 移除旧的 boot/.git,源码直接纳入仓库
- web/ (Vue 3 + Vite + Ant Design Vue, pnpm)
- docs/, scard/, nax/
- refs/INDEX.md + refs/国标/(其余 refs/* 开源子仓库不纳入)
- 已忽略: connector_data/, jweb/, log/, web/{dist,node_modules,.pnpm}, boot/*/target/, .DS_Store, .idea, .vscode
2026-08-05 18:29:12 +08:00

27 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* TC-CONTRACT-021 · 条件不满足时不能办理合约履行
* REQ-012 [FL-5.2] 反向/等价类 P0
*/
export const meta = { tc: 'TC-CONTRACT-021', req: 'REQ-012', title: '条件不满足时不能办理合约履行', type: '反向/等价类', priority: 'P0', route: '/tds/contracts', needs: ['be'] }
export async function run(t) {
await t.login()
const list = await t.apiList('/api/ssw/tds/Contract')
// 非生效合约发起变更应被拒
const nonEff = list.find((c) => c.status !== '02')
if (nonEff) {
const r = await t.api('PUT', `/api/ssw/tds/Contract/${nonEff.id}/Change`, { reason: '反例' })
t.assert(r.code !== 200 || /状态|拒绝|不允许/.test(r.msg || ''), `非生效合约变更被拒:code=${r.code} msg=${r.msg || ''}`)
}
// 终止后不能再变更(status=05/06)
const terminated = list.find((c) => ['05', '06'].includes(c.status))
if (terminated) {
const r = await t.api('PUT', `/api/ssw/tds/Contract/${terminated.id}/Change`, { reason: '反例2' })
t.assert(r.code !== 200, `已终止合约变更被拒:code=${r.code}`)
}
// 缺 reason
const eff = list.find((c) => c.status === '02')
if (eff) {
const r = await t.api('PUT', `/api/ssw/tds/Contract/${eff.id}/Change`, { reason: '' })
t.assert(r.code !== 200 || /不能为空|必填/.test(r.msg || ''), `空 reason 被拒:code=${r.code} msg=${r.msg || ''}`)
}
}