fix: verify BPM field compatibility across list versions

This commit is contained in:
abaishu0730 committed 2026-10-26 17:57:18 +08:00
1 parent c3e948d2e4
commit 5647891446
9 files changed
+139 -8

No files matched your search

+10
View File
@@ -23,8 +23,18 @@ test('a verified unversioned form uses an explicit path and list-version adapter
test('an alias never bypasses a mismatching process, list version or full form path',async()=>{
const path='/YZSoft/Forms/XForm/国内订单评审/国内订单评审V18.aspx';
await assert.rejects(()=>capture(path,'另一流程','3.9'),/流程|表单/);
const candidate=await capture(path,'国内运营订单评审','4.0');assert.equal(candidate.detail.formMatchSource,'verified-form-path-new-list-version');assert.equal(candidate.detail.listProcessVersion,'4.0');assert.equal(candidate.detail.formVersion,'V18');
await assert.rejects(()=>capture(path,'国内运营订单评审','unverified-version'),/版本|核验/);
await assert.rejects(()=>capture(path,'国内运营订单评审',null),/版本|核验/);
await assert.rejects(()=>capture('/YZSoft/Forms/XForm/other/国内订单评审V18.aspx','国内运营订单评审','3.9'),/流程|表单/);
await assert.rejects(()=>capture('/YZSoft/Forms/XForm/unknown.aspx','unknown','1.0'),/核验|版本|表单/);
});
test('new list version only permits read-only capture on a verified versioned form path without inheriting old field omissions',async()=>{
const {resolveFormIdentity}=require('../src/bpm-form-contracts.cjs'),formPath='/YZSoft/Forms/XForm/2012订单评审系列/海外运营订单评审/海外运营订单更改评审V7.aspx';
const identity={url:new URL(origin+formPath),processName:'海外运营订单更改评审',processVersion:'V7'};
const result=resolveFormIdentity(identity,{processName:'海外运营订单更改评审',listProcessVersion:'2.0'});
assert.equal(result.formMatchSource,'verified-form-path-new-list-version');assert.deepEqual(result.contractListVersions,['1.9']);assert.equal(result.ignoredDisplayFields,undefined);
const unversioned='/YZSoft/Forms/XForm/2012订单评审系列/加工订单评审/加工订单通知书.aspx';
assert.throws(()=>resolveFormIdentity({url:new URL(origin+unversioned),processName:'加工订单通知书',processVersion:null},{processName:'加工订单评审',listProcessVersion:'1.1'}),/版本|契约/);
});