test(ai-review): 補 usageSection 結構、resolveMissingLineNumbers 例外與誤報混合平行測試
This commit is contained in:
@@ -307,6 +307,20 @@ describe('postFindingsReview', () => {
|
||||
assert.equal(reviewCalls[0].body, reviewCalls[0].body.trimEnd());
|
||||
});
|
||||
|
||||
it('appends usageSection verbatim after the stats block without altering structure', async () => {
|
||||
const reviewCalls = [];
|
||||
const usageSection = '## 🤖 AI 助理使用量\n\n| x | y |\n| - | - |\n| 1 | 2 |';
|
||||
await postFindingsReview([
|
||||
{ level: 'warning', role: 'Leo', location: 'app/b.js:20', suggestion: 'W', is_new: true },
|
||||
], { postReview: async (args) => { reviewCalls.push(args); }, usageSection });
|
||||
|
||||
const body = reviewCalls[0].body;
|
||||
// 統計區塊在前、usageSection 原樣接在後(中間一個空行);不交錯、不被竄改
|
||||
assert.ok(body.startsWith('## AI Code Review 統計'));
|
||||
assert.ok(body.endsWith(usageSection));
|
||||
assert.match(body, /## AI Code Review 統計[\s\S]*\n\n## 🤖 AI 助理使用量/);
|
||||
});
|
||||
|
||||
it('counts both new and old findings in the summary but only inline-comments new ones', async () => {
|
||||
const reviewCalls = [];
|
||||
await postFindingsReview([
|
||||
|
||||
Reference in New Issue
Block a user