Skip to content

Add unit tests for the key simulation tool asserting price impact is computed and displayed correctly #887

Description

@Chucks1093

Summary

The price simulation tool computes price impact as (simulated_price - spot_price) / spot_price * 100. Unit tests should assert the computation and display are correct for positive, zero, and negative price impact values.

Scope

  • Test that simulated_price of 110 with spot_price of 100 shows price impact of +10.00%
  • Test that simulated_price equal to spot_price shows price impact of 0.00%
  • Test that the custom quantity input fires a debounced fetch after 300ms
  • Test that a fetch error shows 'Unable to simulate price' and hides the impact value
  • Test that the loading skeleton is shown while the fetch is in progress

Acceptance Criteria

  • +10% impact computed and displayed correctly
  • 0% impact computed and displayed correctly
  • Custom quantity triggers debounced fetch at 300ms
  • Fetch error shows correct error message
  • Loading skeleton shown during fetch

ETA: 12 hours


Coordinate on Telegram

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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