Skip to content

Add unit tests for computePriceChange helper at positive, negative, and zero change scenarios #661

Description

@Chucks1093

Summary

The computePriceChange helper computes a signed percentage but has no unit tests covering all three outcome signs. Tests should explicitly verify positive, negative, and zero change and confirm the result is always rounded to two decimal places.

Scope

  • Test oldest snapshot 100, latest 150 → returns 50.00
  • Test oldest snapshot 200, latest 100 → returns -50.00
  • Test oldest snapshot 100, latest 100 → returns 0.00
  • Test a fractional result (oldest 3, latest 4) → returns 33.33 (rounded, not truncated)

Acceptance Criteria

  • Positive change returns correct positive percentage
  • Negative change returns correct negative percentage
  • Zero change returns 0.00
  • Fractional result rounded to two decimal places

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