Skip to content

Test/format utils portfolio route coverage - #326

Merged
valoryyaa-byte merged 4 commits into
RWA-ToolKit:mainfrom
Almikefred:test/format-utils-portfolio-route-coverage
Aug 31, 2026
Merged

Test/format utils portfolio route coverage#326
valoryyaa-byte merged 4 commits into
RWA-ToolKit:mainfrom
Almikefred:test/format-utils-portfolio-route-coverage

Conversation

@Almikefred

Copy link
Copy Markdown
Contributor

Summary

Adds test coverage for three pure lib/format.ts utility functions — parseTokenAmount's accept/reject boundaries, formatRawPlain's exact round-trip behavior against parseTokenAmount (including
trailing-zero handling), and compactNumber's K/M/B threshold behavior with explicit confirmation of the sub-1,000,000 non-compaction rule — plus route-level coverage for /portfolio's connect-prompt
and holdings-list states.

Changes

#250 — test: add coverage for parseTokenAmount

  • All three accepted and five rejected input cases covered, plus excess-decimal-places rejection, matched against the real implementation.

#251 — test: add coverage for formatRawPlain

  • Round-trip tests through parseTokenAmount confirmed exact for representative values, with explicit trailing-zero handling tested per the real implementation's actual normalization behavior.

#252 — test: add coverage for compactNumber

  • K/M/B threshold boundary tests with decimal rounding behavior, and 1,000,000 non-compaction rule confirmed against real behavior.

#249 — test: add route-level coverage for /portfolio

  • Disconnected → connect prompt; connected → holdings list, using existing test mocking patterns.

Notes

  • Test-only delivery: no install/build/test/scripts run during implementation — every assertion was hand-verified by reading the real function/component implementations.
  • Committer: Almikefred.
  • No shared lib/contracts.ts mock helper from prior route-coverage work was found in this repo; existing test mocking patterns in components were reused for portfolio page tests.

Closes #250, Closes #251, Closes #252, Closes #249

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Almikefred Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@valoryyaa-byte
valoryyaa-byte merged commit 7d52a19 into RWA-ToolKit:main Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants