Skip to content

Add unit tests for the slippage tolerance selector asserting correct max_price and min_price computation #877

Description

@Chucks1093

Summary

The slippage tolerance selector computes max_price and min_price from the preview price and selected tolerance. Unit tests should assert these values are computed correctly for each preset tolerance and that the custom input is validated properly.

Scope

  • Test that 0.5% tolerance on a preview price of 100 XLM computes max_price of 100.5 XLM
  • Test that 5% tolerance on a preview price of 100 XLM computes max_price of 105 XLM
  • Test that 1% sell tolerance on a preview price of 100 XLM computes min_price of 99 XLM
  • Test that a custom tolerance of 0% is accepted and computes max_price equal to preview price
  • Test that a custom tolerance above 50% shows a validation error and disables the confirm button

Acceptance Criteria

  • 0.5% buy tolerance computed correctly
  • 5% buy tolerance computed correctly
  • 1% sell tolerance computed correctly
  • 0% custom tolerance sets max_price equal to preview price
  • Custom tolerance above 50% shows error and disables confirm

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