Skip to content

Test the money conversion helpers #36

Open

Description

@imshashank

tests/revenue-money.test.ts checks formatMoney output for USD, JPY and KWD. Nothing tests the conversion helpers in src/components/money.ts: toMinor, fromMinor, minorDigits and minorStep. These turn what a user types into stored minor units, so a rounding bug silently changes deal values.

Done when

  • Tests cover each helper for a two-decimal (USD), zero-decimal (JPY) and three-decimal (KWD) currency, plus rounding of inputs with too many decimals and empty or invalid input.
  • They live in tests/revenue-money.test.ts or a new tests/money.test.ts, and bun run test passes.

Activity

  1. added
    good first issue
    tests
    on Oct 6, 2026
  2. Ehtasham-Yasin commented on Oct 6, 2026

    @Ehtasham-Yasin
    Contributor

    I would like to work on this. I will add focused tests for the money helpers covering USD, JPY and KWD/BHD, including excess-decimal rounding, and run the required checks. I plan to use AI assistance for implementation, with manual review and test verification. Please let me know if that conflicts with your contribution policy or if someone is already working on it.

  3. changed the title [-]Add unit tests for the money helpers[/-] [+]Test the money conversion helpers[/+] on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuetests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions