Skip to content

Add unit tests for the portfolio page correctly summing total XLM value across all held keys #701

Description

@Chucks1093

Summary

The portfolio page displays the total XLM value of all keys the user holds by summing (current price × quantity) across each position. Unit tests should confirm the total is correct for mixed portfolios and that it updates when a position's price changes.

Scope

  • Test a portfolio with two positions returns the correct summed XLM total
  • Test a portfolio with one position at quantity 0 is excluded from the total
  • Test a portfolio with all positions at price 0 returns a total of 0 XLM
  • Test that updating one position's price via the mock query causes the total to re-compute
  • Assert the total is formatted to 2 decimal places in the rendered output

Acceptance Criteria

  • Correct total for a multi-position portfolio
  • Zero-quantity positions excluded from total
  • Total of 0 XLM displayed correctly when all prices are 0
  • Total updates reactively when position price changes
  • Total formatted to 2 decimal places in the UI

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions