Add comprehensive unit tests for transfer and quote contracts, status… - #292
Open
Ayom04 wants to merge 2 commits into
Open
Add comprehensive unit tests for transfer and quote contracts, status…#292Ayom04 wants to merge 2 commits into
Ayom04 wants to merge 2 commits into
Conversation
… badges, and money utilities - Implement tests for StatusBadge component to ensure correct rendering of transfer statuses and aliases. - Create tests for contract schema validation, covering various scenarios including valid and invalid payloads. - Add tests for money utility functions to validate parsing, formatting, and arithmetic operations on monetary values. - Introduce tests for quote contract parsing and fee calculation, ensuring accurate handling of quotes and associated rates. - Develop tests for receipt rendering components to verify correct display of transfer and quote information. - Ensure robust handling of breaking changes in transfer and quote contracts with actionable error messages.
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.
This pull request introduces several improvements to how transfer statuses and monetary amounts are handled and displayed throughout the application. It enhances accessibility and robustness by normalizing status values, improving error handling for contract violations, and ensuring all monetary values are formatted consistently. Additionally, the visual representation of transfer statuses has been expanded and refined across the UI and print styles.
Status handling and display improvements:
quoted,validating,authorizing,expired, and an explicitunknownstate, with human-readable labels and descriptions. Status normalization ensures consistent display and filtering, even for legacy or provider-specific spellings. (src/components/StatusBadge.jsx[1]src/components/StatusBadge.stories.jsx[2] [3]src/pages/Transfers.jsx[4] [5] [6]src/components/StatusBadge.css[1] [2] [3]src/print.css[4]Monetary amount formatting:
formatAmountwithformatMoneythroughout the UI to ensure consistent currency formatting and to handle unparseable values gracefully. (src/components/QuoteCard.jsx[1] [2] [3]src/components/TransferRow.jsx[4] [5]src/pages/Transfers.jsx[6] [7]Error handling and contract validation:
src/hooks/useTransfers.js[1] [2]src/pages/SendMoney.jsx[3] [4]src/services/api.js[5]Storybook and documentation updates:
StatusBadgeto cover all statuses, legacy spellings, and unknown states, ensuring that component documentation stays in sync with contract definitions. (src/components/StatusBadge.stories.jsx[1] [2]These changes collectively improve the reliability, accessibility, and maintainability of the application's handling and display of transfer statuses and amounts.
closes #282