fix: guard EventSource for jsdom test env, add rate-limits MSW handler

This commit is contained in:
Celes Renata
2026-04-16 08:19:53 +00:00
parent 58a05ca322
commit c5e9644f6f
2 changed files with 13 additions and 0 deletions
+10
View File
@@ -118,6 +118,16 @@ export const handlers = [
// Health
http.get('/api/health', () => HttpResponse.json({ status: 'ok' })),
// System
http.get('/api/system/rate-limits', () => HttpResponse.json({
polygon_global_limit: 45,
polygon_source_types: ['market_api', 'news_api'],
per_type_limits: { market_api: 20, news_api: 20 },
cadences_seconds: { market_api: 300, news_api: 300 },
market_api: { rate_per_minute: 20, cadence_seconds: 300, max_tickers_per_cycle: 100, active_sources: 51 },
news_api: { rate_per_minute: 20, cadence_seconds: 300, active_sources: 50 },
})),
// Macro events and impacts
http.get('/api/macro/events', () => HttpResponse.json(mockMacroEvents)),
http.get('/api/macro/events/:id', ({ params }) => {