Skip to content

Add integration tests for the portfolio analytics flow - #1105

Merged
Manuelshub merged 1 commit into
Nanle-code:masterfrom
aishagbadamosi:Add-Integration-Tests-for-Portfolio-Analytics-Flow
Sep 28, 2026
Merged

Manuelshub merged 1 commit into
Nanle-code:masterfrom
aishagbadamosi:Add-Integration-Tests-for-Portfolio-Analytics-Flow

Conversation

@aishagbadamosi

Copy link
Copy Markdown
Contributor

Adds two integration test suites covering the full dashboard pipeline — account balances → CoinGecko USD estimates → Recharts allocation/performance/risk views → CSV export — 67 tests, all passing.

  • tests/integration/portfolioAnalyticsCalculations.test.ts (52 tests) covers every portfolio calculation: USD pricing, unpriced assets, allocation, diversification, concentration, counterparty risk, volatility, Sharpe ratio, P&L, correlation, rebalancing, historical reconstruction, summaries, and CSV row generation.
  • tests/integration/portfolioAnalyticsFlow.test.tsx (15 tests) drives the real PortfolioValue component through two-, one-, five-, unpriced-, empty- and disconnected-account portfolios, plus loading, price-API failure, refresh recovery, and Horizon history failure. Only the seams are stubbed — the store, the Horizon server, and Recharts' ResponsiveContainer — so all pricing, analytics, chart and export code under test is production code.

closes #251

Summary

Adds two integration test suites covering the full dashboard pipeline — account balances → CoinGecko USD estimates → Recharts allocation/performance/risk views → CSV export — 67 tests, all passing.

  • tests/integration/portfolioAnalyticsCalculations.test.ts (52 tests) covers every portfolio calculation: USD pricing, unpriced assets, allocation, diversification, concentration, counterparty risk, volatility, Sharpe ratio, P&L, correlation, rebalancing, historical reconstruction, summaries, and CSV row generation.
  • tests/integration/portfolioAnalyticsFlow.test.tsx (15 tests) drives the real PortfolioValue component through two-, one-, five-, unpriced-, empty- and disconnected-account portfolios, plus loading, price-API failure, refresh recovery, and Horizon history failure. Only the seams are stubbed — the store, the Horizon server, and Recharts' ResponsiveContainer — so all pricing, analytics, chart and export code under test is production code.

Closes #251

How was this tested?

Merge requirements

A PR is merged only when every box below is true. See
Merge requirements for the full policy.

  • All required CI checks pass on the latest commit (not just an earlier push).
  • No required checks are failing, pending, or skipped — re-run or fix them; do not ask for a merge while any are outstanding.
  • The branch has no merge conflicts with the target branch (rebase or merge master if GitHub shows "This branch has conflicts").
  • Tests were added or updated for the change (primary flow, a boundary case, and a failure case).
  • Docs were updated where behaviour, configuration, or security posture changed.

Security-sensitive changes

  • This PR touches a path covered by .github/CODEOWNERS (wallet, auth, cryptography, CI) and a code owner has been requested for review.
  • I described any change to key handling, signing, session lifetime, or trusted endpoints above.

Adds two integration test suites covering the full dashboard pipeline — account balances → CoinGecko USD estimates → Recharts allocation/performance/risk views → CSV export — 67 tests, all passing.
- tests/integration/portfolioAnalyticsCalculations.test.ts (52 tests) covers every portfolio calculation: USD pricing, unpriced assets, allocation, diversification, concentration, counterparty risk, volatility, Sharpe ratio, P&L, correlation, rebalancing, historical reconstruction, summaries, and CSV row generation.
- tests/integration/portfolioAnalyticsFlow.test.tsx (15 tests) drives the real PortfolioValue component through two-, one-, five-, unpriced-, empty- and disconnected-account portfolios, plus loading, price-API failure, refresh recovery, and Horizon history failure.
Only the seams are stubbed — the store, the Horizon server, and Recharts' ResponsiveContainer — so all pricing, analytics, chart and export code under test is production code.

closes Nanle-code#251
@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

@aishagbadamosi is attempting to deploy a commit to the nanle-code's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Manuelshub
Manuelshub merged commit f6b973c into Nanle-code:master Sep 28, 2026
4 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Integration Tests for Portfolio Analytics Flow

2 participants