fix(評論發布): 只統計新問題並排序 comments
This commit is contained in:
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user