Skip to content

test: add integration test for holdings total_value multi snapshot up…#592

Open
toniasteve15-ui wants to merge 1 commit into
accesslayerorg:mainfrom
toniasteve15-ui:test/584-holdings-multiple-snapshots
Open

test: add integration test for holdings total_value multi snapshot up…#592
toniasteve15-ui wants to merge 1 commit into
accesslayerorg:mainfrom
toniasteve15-ui:test/584-holdings-multiple-snapshots

Conversation

@toniasteve15-ui

Copy link
Copy Markdown

#closes #584

Add integration test for holdings endpoint returning correct total_value after multiple price snapshot updates

Closes #584

Description

This PR introduces a new integration test for the /api/v1/wallets/:address/holdings endpoint to ensure the total_value calculation accurately tracks dynamic price updates.

Summary

The holdings endpoint computes the total value of held keys dynamically from the latest price snapshot. This integration test confirms the value is recalculated correctly when a creator's price snapshot is updated multiple times, guaranteeing that the most recent snapshot value is always utilized.

Scope Covered

  • Seeds a user wallet holding keys for one specific creator (5 keys held).
  • Updates the creator's price snapshot three sequential times to distinct values (100, 250, 300).
  • Hits the /holdings API endpoint after each snapshot update.
  • Asserts that total_value consistently aligns with the most recent snapshot (500, 1250, 1500).

Acceptance Criteria Met

  • total_value uses the latest snapshot after each update
  • Previous snapshot values do not bleed into the response
  • Field is accurate across all three snapshot updates

Testing Instructions

  1. Run local dependencies (database):
    pnpm db:up
  2. Execute the integration test suite:
    pnpm test src/modules/wallets/__tests__/wallet-holdings-multiple-snapshots.integration.test.ts

#closes

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 test for holdings endpoint returning correct total_value after multiple price snapshot updates

2 participants