perf: memo GridCard, fuse save fns, fix slash tab active color
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user