perf: memo GridCard, fuse save fns, fix slash tab active color
Some checks failed
CI / Lint, Unit Tests & Build (push) Failing after 1m32s
CI / Deploy production (on server) (push) Has been skipped

This commit is contained in:
Antigravity
2026-06-14 14:06:05 +00:00
parent a8785ed4f1
commit a623454347
120 changed files with 12301 additions and 785 deletions

View File

@@ -72,8 +72,8 @@ describe('entitlements', () => {
const result = await canUseFeature('user1', 'semantic_search');
expect(result.allowed).toBe(true);
expect(result.limit).toBe(100);
expect(result.remaining).toBe(50);
expect(result.limit).toBe(200);
expect(result.remaining).toBe(150);
});
it('should allow ENTERPRISE user unlimited features', async () => {
@@ -130,24 +130,13 @@ describe('entitlements', () => {
expect(result.limit).toBe(30);
});
it('should allow BASIC user to use chat when under limit (10)', async () => {
it('should deny BASIC user to use chat by default (strict lock)', async () => {
mockActiveSubscription('BASIC');
vi.mocked(redis.get).mockResolvedValue('5');
const result = await canUseFeature('user1', 'chat');
expect(result.allowed).toBe(true);
expect(result.limit).toBe(10);
});
it('should deny BASIC user when chat quota is exhausted', async () => {
mockActiveSubscription('BASIC');
vi.mocked(redis.get).mockResolvedValue('10');
const result = await canUseFeature('user1', 'chat');
expect(result.allowed).toBe(false);
expect(result.reason).toBe('QUOTA_EXCEEDED');
expect(result.reason).toBe('FEATURE_NOT_AVAILABLE');
});
it('should fail-open when Redis is down', async () => {
@@ -209,7 +198,7 @@ describe('entitlements', () => {
const result = await canUseFeature('user1', 'semantic_search');
expect(result.limit).toBe(100);
expect(result.limit).toBe(200);
});
it('should drop to BASIC for PAST_DUE past billing period', async () => {