refactor: enforce 800 line source limits

This commit is contained in:
caoxiaozhu
2026-06-22 11:58:53 +08:00
parent 08a4fa3577
commit 6d33ba5742
150 changed files with 27413 additions and 23791 deletions

View File

@@ -146,3 +146,26 @@ test('AI conversation renderer keeps separated step bullets in one numbered sequ
assert.match(rendered, /<span class="ai-html-step-index">2<\/span>[\s\S]*预算与审批预审/)
assert.match(rendered, /<span class="ai-html-step-index">3<\/span>[\s\S]*申请表生成/)
})
test('AI conversation renderer hides noisy attachment association reason fragments', () => {
const rendered = renderAiConversationHtml([
'### 我已先识别票据,并匹配到最可能的报销单',
'',
'本次附件1 份2月20 武汉-上海.pdf',
'',
'识别摘要2月20 武汉-上海.pdf电子发票铁路电子客票 武汉-上海 票价 354元',
'',
'推荐关联R74CB7C2R',
'',
'单据事项::26429165800002785705; :2026; 05',
'',
'匹配依据:票据日期与报销单日期一致;地点或行程包含 上海;当前单据仍是可归集草稿'
].join('\n'))
assert.match(rendered, /ai-attachment-association-card/)
assert.match(rendered, /R74CB7C2R/)
assert.doesNotMatch(rendered, /单据事项/)
assert.doesNotMatch(rendered, /关联事项/)
assert.doesNotMatch(rendered, /26429165800002785705/)
assert.doesNotMatch(rendered, /:2026/)
})