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

@@ -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', () => {