test(ai-review): 補 judgeConversations 空陣列回應視為 open 的邊界測試

This commit is contained in:
Jeffery
2026-06-23 15:50:41 +08:00
parent 66e42d605c
commit 1919433df1
+9
View File
@@ -120,6 +120,15 @@ describe('judgeConversations', () => {
assert.deepEqual(verdicts, [{ idx: 0, verdict: 'open' }]);
});
it('treats an empty AI response array as all open (conservative)', async () => {
const items = [{ idx: 0 }, { idx: 1 }];
const verdicts = await judgeConversations(items, async () => []);
assert.deepEqual(verdicts, [
{ idx: 0, verdict: 'open' },
{ idx: 1, verdict: 'open' },
]);
});
it('ignores entries with unknown verdict or non-integer idx', async () => {
const items = [{ idx: 0 }, { idx: 1 }];
const chatFn = async () => [