test(ai-review): 補關閉所有 comment、部分 resolve 失敗、百分比邊界與 usageSection 排版測試

This commit is contained in:
Jeffery
2026-06-23 14:58:15 +08:00
parent 0cb6ffde3e
commit 4a0f8bcc36
3 changed files with 42 additions and 0 deletions
+7
View File
@@ -192,6 +192,13 @@ describe('resolveRemainingPercent', () => {
assert.equal(pct.percent, null); // limit > 0 守衛擋掉除以零
assert.ok(typeof pct.reason === 'string' && pct.reason.length > 0);
});
it('reports 100% when remaining equals limit and 0% when remaining is 0', () => {
const full = resolveRemainingPercent({ available: true, used: 0, limit: 100, remaining: 100, currency: 'USD' }, null);
assert.equal(full.percent, 100);
const empty = resolveRemainingPercent({ available: true, used: 100, limit: 100, remaining: 0, currency: 'USD' }, null);
assert.equal(empty.percent, 0);
});
});
describe('formatUsageStats', () => {