-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: simulation Fiat precision and Fiat flickers different value befo…
…re decimals are applied (#13371) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** - Fix fiat precision. We should show expected digits instead of 0s. - Replaces areas where value is coerced to number - Fix related FiatDisplay test - invalid test where we called toBeDefined instead of toBeTruthy from queryByText - removed useFiatFormatter mock - fix invalid showFiatInTestnets mock - fix hideFiatForTestnet test related mocks since in useHideFiatForTestnet ```TEST_NETWORK_IDS.includes(chainId) && !showFiatInTestnets;``` was returning true in all cases as chainId was undefined. - Update FiatDisplay value to replace $100.00 → $100 and $100.2 → $100.20. useFiatFormatter formatted as expected. - Fixes fiat flickering issue while data is still being fetched - adds placeholder element while token details are pending ## **Related issues** Fixes: #13387 ## **Manual testing steps** 1. Go to https://develop.d3bkcslj57l47p.amplifyapp.com/ 2. Trigger Permit Batch ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <img width="320" src="https://github.com/user-attachments/assets/30dd5d66-91a3-4fc1-8a6a-c5ede4134c8c"> ### **After example** <img width="320" src="https://github.com/user-attachments/assets/c5ad4c15-bed8-4428-a7f0-bbcf37f5c9c0"> ### **Real after with hidden value if "Unlimited" is shown w/ some token icons still loading ** <img width="320" src="https://github.com/user-attachments/assets/b8452419-254a-46d8-93af-fd083535e949"> ### **Before flickering issue ** https://github.com/user-attachments/assets/52178518-04ed-49fd-8568-d40d1b6c0637 ### **After** https://github.com/user-attachments/assets/2ef9fc1a-bd0f-457b-bf20-9e5250b1df97 ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
- Loading branch information
Showing
11 changed files
with
187 additions
and
147 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.