test: add unit tests for components/ui/token-amount.tsx - #556
Merged
Austinaminu2 merged 1 commit intoAug 20, 2026
Merged
Conversation
Closes FlowwStar#509 - Tests formatted display across representative values (zero, whole numbers, fractions, large amounts with thousand separators, negatives) - Tests decimal handling for 7-decimal tokens (USDC, XLM, EURC) and 0-decimal tokens, plus maxFractionDigits overrides - Tests symbol rendering: visible by default, hidden via showSymbol=false, custom symbolClassName applied correctly - Tests compact notation mode (K/M suffixes) via the compact prop - Tests className and base CSS class passthrough on the outer span - 24 tests, all passing (100% branch/statement/function/line coverage on token-amount.tsx)
peterexcel494-oss
had a problem deploying
to
staging
August 18, 2026 21:10 — with
GitHub Actions
Failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #509
Adds a comprehensive unit test suite for
components/ui/token-amount.tsx, which had no test coverage prior to this PR.What was tested
The test file is located at
__tests__/components/token-amount.tsxand covers:1,234,567), and negative amountsmaxFractionDigitsprop overrides at 0, 2, and default 4showSymbol={false}, correct symbol per token, and customsymbolClassNameappliedcompactprop produces K/M suffixes (e.g.1.2K,2.5M), with symbol show/hide also tested in compact modefont-monoandtabular-nums, and accepts extra classes viaclassNameTest results
24 tests, all passing.
token-amount.tsxachieves 100% statement/branch/function/line coverage.Notes
6 pre-existing test failures in
use-contract.test.tsanduse-token-price.test.tsare unrelated to this change and were already failing onmainbefore this PR.