test(ai-review): 補關閉所有 comment、部分 resolve 失敗、百分比邊界與 usageSection 排版測試
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user