Skip to content

Add unit tests for price snapshot helper computing percentage change between two snapshots #603

Description

@Chucks1093

Summary

The price snapshot helper that computes percentage change between two snapshots is used in the creator list and price alert paths but has no unit tests. Tests should cover positive change, negative change, zero change, and a zero starting price edge case.

Scope

  • Test positive change: price moves from 100 to 150 → returns 50.00
  • Test negative change: price moves from 200 to 100 → returns -50.00
  • Test zero change: same price → returns 0.00
  • Test zero starting price: returns null or a sentinel to signal undefined percentage

Acceptance Criteria

  • Positive change returns correct percentage
  • Negative change returns correct negative percentage
  • Zero change returns 0.00
  • Zero starting price handled without division-by-zero error

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions