perf: memo GridCard, fuse save fns, fix slash tab active color
This commit is contained in:
@@ -117,6 +117,23 @@ describe('brainstorm host-pays billing (Story 3.4)', () => {
|
||||
checkSessionEntitlementOrThrow('host-1', 'guest-9', true, 'brainstorm_expand'),
|
||||
).rejects.toThrow()
|
||||
})
|
||||
|
||||
it('AC10: host BYOK + guest quota empty still bills host (guest has no quota, host pays)', async () => {
|
||||
vi.mocked(hasAnyActiveByok).mockResolvedValue(true)
|
||||
mockActiveSubscription('PRO')
|
||||
vi.mocked(redis.eval).mockResolvedValue(1)
|
||||
|
||||
// Guest's quota is empty (simulated by checking guest's quota returns 0)
|
||||
vi.mocked(redis.get).mockResolvedValue('0')
|
||||
|
||||
await checkSessionEntitlementOrThrow('host-1', 'guest-9', true, 'brainstorm_expand')
|
||||
|
||||
// Verify that host's redis key was incremented, not guest's
|
||||
expect(redis.eval).toHaveBeenCalled()
|
||||
const keyArg = String(vi.mocked(redis.eval).mock.calls[0]?.[2])
|
||||
expect(keyArg).toContain('host-1')
|
||||
expect(keyArg).not.toContain('guest-9')
|
||||
})
|
||||
})
|
||||
|
||||
describe('QuotaExceededError.toJSON', () => {
|
||||
|
||||
Reference in New Issue
Block a user