fix(quotas): unifier le décompte IA (BYOK, rollback) et combler les fuites
Centralise la réserve via ai-quota, corrige admin unavailable (-1), brancher les routes sans quota et le host-pays brainstorm, avec usage-meter élargi, noms de clusters, MCP et ajustements dashboard/insights. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
19
memento-note/tests/unit/plan-entitlements.test.ts
Normal file
19
memento-note/tests/unit/plan-entitlements.test.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import {
|
||||
ENTITLEMENT_UNAVAILABLE,
|
||||
FALLBACK_TIER_LIMITS,
|
||||
} from '@/lib/plan-entitlements';
|
||||
|
||||
describe('plan-entitlements unavailable sentinel', () => {
|
||||
it('ENTITLEMENT_UNAVAILABLE should be -1', () => {
|
||||
expect(ENTITLEMENT_UNAVAILABLE).toBe(-1);
|
||||
});
|
||||
|
||||
it('fallback limits should not use unavailable sentinel', () => {
|
||||
for (const tier of Object.keys(FALLBACK_TIER_LIMITS)) {
|
||||
for (const [, limit] of Object.entries(FALLBACK_TIER_LIMITS[tier as keyof typeof FALLBACK_TIER_LIMITS])) {
|
||||
expect(limit).not.toBe(ENTITLEMENT_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user