Repository navigation
feat: integration tests for useWalletBalance hook and unit tests for property similarity scorer, address formatter, and price formatter - #1532
Merged
nanaf6203-bit merged 1 commit intoNov 24, 2026
Conversation
…property similarity scorer, address formatter, and price formatter Closes MettaChain#1453 Closes MettaChain#1450 Closes MettaChain#1447 Closes MettaChain#1446
|
@Mai-Fura 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! 🚀 |
nanaf6203-bit
approved these changes
Nov 24, 2026
nanaf6203-bit
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me — thanks for putting this together!
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
Resolves all issues assigned to @Mai-Fura.
Changes
ui-extensions/tests/useWalletBalance.test.tsx— Integration tests forWalletBalanceCard(which wraps theuseBalance/useAccountwagmi hooks). Covers: balance fetching for a connected wallet, multi-chain balance aggregation across Ethereum / Polygon / BSC, loading state (isFetching), missing-data error state (-dash), manual refresh button (disable + re-enable timing), and disconnect/cleanup state (prompt shown when not connected). wagmi hooks are fully mocked.ui-extensions/tests/propertySimilarityScorer.test.ts— Unit tests forsimilarityandmostSimilarinpropertyMath.ts. Covers identical properties (score = 1.0), completely different properties (score ≈ 0), partial match, Jaccard amenity scoring, missing fields, custom weight overrides, and descending-sort guarantee inmostSimilar.ui-extensions/tests/blockchainAddressFormatter.test.ts— Unit tests forformatAddressinformatters.ts. Covers standard truncation (default prefix/suffix), custom prefix/suffix lengths, the no-truncation guard, invalid addresses (too short, missing 0x, non-hex chars, wrong length), checksum vs lowercase preservation, and null/undefined/number inputs.ui-extensions/tests/propertyPriceFormatter.test.ts— Unit tests forformatPriceinformatters.ts. Covers USD, EUR, JPY (zero decimals), K/M/B compact abbreviation, zero and negative values (including -0), Arabic/RTL locale, and edge inputs (Infinity, NaN, MAX_SAFE_INTEGER). 100% branch coverage offormatPrice.All changes are confined to
ui-extensions/as required by the isolation statement in each issue.Closes
Closes #1453
Closes #1450
Closes #1447
Closes #1446