fix: expose observed historical processes in matching catalog

This commit is contained in:
abaishu0730 committed 2026-10-26 17:09:35 +08:00
1 parent b17b975812
commit c3e948d2e4
12 files changed
+147 -20

No files matched your search

@@ -19,6 +19,13 @@ test('Excel scope import uses the same Unicode normalization as the authoritativ
const overseas=store.get('rules','overseas-notice').draft,p=previewImport(store,sourceRows(overseas),'admin');commitImport(store,{id:p.id},'admin');
assert.deepEqual(store.get('rules',overseas.id).draft.nodeNames,['订单专员(订单通知书)']);
});
test('historically observed process names keep their punctuation while missing nodes still warn',()=>{
const store=fixture(),catalog=require('../../src/modules/order-rules/scope-catalog.cjs'),name='历史流程(国内)';
catalog.observe(store,[{source:'history',configurationOnly:true,processName:name,nodeName:'历史查看(未提供办理节点)'}]);
const old=store.get('rules','bs-change').draft,input=sourceRows(old);input.rows[1][2]=name;
const plan=previewImport(store,input,'admin');assert.equal(plan.canCommit,true);assert.equal(plan.rows[0].preview.scopes[0].processName,name);assert.ok(plan.rows[0].warnings.some(w=>/节点/.test(w)));assert.deepEqual(catalog.directory(store).scopes,[]);
});
test('legacy Excel attachment descriptions and explicit yes cannot enable PDF email attachments',()=>{
for(const explicit of [false,true]){
const store=fixture(),old=store.get('rules','bs-change').draft,input=sourceRows(old,'附件:订单通知书PDF');