fix(評論發布): 只統計新問題並排序 comments
AI / 計算版本號 (pull_request) Successful in 2s
AI / Code Review (pull_request) Successful in 1m13s

This commit is contained in:
2026-06-22 23:02:21 +08:00
parent d04a256a3b
commit 279bcc2101
3 changed files with 20 additions and 9 deletions
+3 -1
View File
@@ -196,12 +196,14 @@ describe('postFindingsReview', () => {
];
await postFindingsReview(findings, {
summaryFindings: findings.filter(f => f.is_new !== false),
commentFindings: findings,
postReview: async (args) => { reviewCalls.push(args); },
});
assert.equal(reviewCalls.length, 1);
assert.match(reviewCalls[0].body, /\| 🔴 嚴重 \| 🟡 警告 \| 🔵 建議 \|/);
assert.match(reviewCalls[0].body, /\| 1 筆 \| 1 筆 \| 1 筆 \|/);
assert.match(reviewCalls[0].body, /\| 0 筆 \| 1 筆 \| 1 筆 \|/);
assert.deepEqual(
reviewCalls[0].comments.map(c => c.path),
['app/a.js', 'app/b.js', 'app/c.js'],