Improve frontend display copy and tests#175
Conversation
Frontend (197 tests, Vitest): - Setup: vitest.config.ts, jest-dom, jsdom, global mocks - lib/: utils, tools, formatters, apiAuth, runReports, indicators - stores/: Zustand agent store (messages, streaming, session cache, SSE) - hooks/: useDarkMode (localStorage + class toggle), useSSE (reconnect, dedup, backoff) - components/: ProgressBar, AgentAvatar, WelcomeScreen, MessageBubble, MetricsCard, ThinkingTimeline, ToolProgressIndicator, Skeleton, ErrorBoundary, ConnectionBanner Backend (15 new tests): - Loopback auth bypass: loopback trusted even when API_AUTH_KEY is set - Crypto fallback: yfinance added as third-tier crypto data source - yfinance crypto: BTC-USDT/USDC→USD conversion, crypto market registration - Settings API: updated test to reflect loopback trust-first policy CI (.github/workflows/test.yml): - pytest: --cov=agent --cov-report=term-missing --cov-report=xml - Added frontend test step (npx vitest run) Coverage config (pyproject.toml): - [tool.coverage.run] with source/omit rules - [tool.coverage.report] with show_missing, skip_empty Source changes: - api_server.py: loopback clients bypass auth unconditionally - registry.py: yfinance added to crypto FALLBACK_CHAINS - yfinance_loader.py: USDT/USDC→USD symbol conversion, crypto market .gitignore: exclude .coverage, coverage.xml, node_modules/, results/
- Add i18n display module for internationalization - Refactor and simplify chat components (WelcomeScreen, RunnerStatus, MandateProposalCard) - Clean up chart components (CandlestickChart, EquityChart, CorrelationMatrix) - Update page components (Agent, AlphaZoo, Compare, Settings, RunDetail) - Update tests to match component changes - Minor fixes to formatters, api, layout, and router
Cherry-picked the test-infra commit from #175 (sambazhu): vitest setup + 19 frontend test files (197 tests), backend auth/path-traversal/CORS tests, yfinance crypto fallback (BTC-USDT->BTC-USD), and CI coverage + frontend-test steps. Dropped the PR's separate i18n commit to stay consistent with #163. Fix: align @vitest/coverage-v8 to ^3.2.6 (was ^4.1.8, incompatible with vitest ^3.2.6 - blocked npm install and the new npm ci CI step).
|
Thanks @sambazhu — really solid test work. 🙏 I've cherry-picked the test-infra commit to One fix on the way in: I did not bring in the second commit (i18n + component cleanup), to stay consistent with the decision in #163 to hold off on bundling i18n until the UI stabilizes. Closing this PR since the test suite has landed independently — thanks again for the contribution! |
Summary
Tests