fix(#608): show fee-unavailable warning in DonationModal on RPC error#701
fix(#608): show fee-unavailable warning in DonationModal on RPC error#701Ayilojay wants to merge 1 commit into
Conversation
…C error
- usePlatformFee already returned isError and fell back to 300 bps;
DonationModal already rendered the amber warning banner — the runtime
behaviour was correct.
- Add missing closeAriaLabel and amountPlaceholder keys to the
Donation i18n namespace in en.json and es.json so those strings
resolve correctly at runtime instead of falling back to the raw key.
- Overhaul DonationModal.test.tsx:
• Make usePlatformFee mock controllable per-test (jest.fn) so
isError: true / false can be toggled independently.
• Add useLocale to the next-intl mock (was missing, crashed every test).
• Fill in all translation keys the component uses
(closeAriaLabel, amountPlaceholder, waitingSignature, validation
error strings) so assertions match rendered output.
• Add two explicit tests:
'shows fee-unavailable warning when isError is true'
'does not show fee-unavailable warning when isError is false'
• Fix six pre-existing broken tests that queried by raw i18n key
names instead of resolved strings (amountLabel → 'Amount (XLM)',
donateWithAmount → /donate N xlm/i, submittingTransaction →
actual sentence, platformFeeNote → regex, etc.).
• Update validation-error test to reflect actual component behaviour:
inline validation sets aria-invalid but does not render a text
error paragraph until form submission is attempted.
All 9 DonationModal tests pass; build is clean.
|
@Ayilojay 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! 🚀 |
|
Auto-review failed (API error). Leaving PR for human review. |
davidmaronio
left a comment
There was a problem hiding this comment.
the product code is clean, isError threaded through usePlatformFee and rendered as a role=alert warning with en/es keys, good. one real fix: tsc fails at src/tests/components/DonationModal.test.tsx:30 (TS2556), mockUsePlatformFee is defined with no params but called with ...args, give it a rest param jest.fn((..._args: unknown[]) => ({...})) (and run prettier on that file). you overlap #703 on DonationModal fee ux (not a dup), sequence with whoever lands first. Playwright red is shared/broken.
usePlatformFee already returned isError and fell back to 300 bps; DonationModal already rendered the amber warning banner — the runtime behaviour was correct.
Add missing closeAriaLabel and amountPlaceholder keys to the Donation i18n namespace in en.json and es.json so those strings resolve correctly at runtime instead of falling back to the raw key.
Overhaul DonationModal.test.tsx: • Make usePlatformFee mock controllable per-test (jest.fn) so isError: true / false can be toggled independently. • Add useLocale to the next-intl mock (was missing, crashed every test). • Fill in all translation keys the component uses (closeAriaLabel, amountPlaceholder, waitingSignature, validation error strings) so assertions match rendered output. • Add two explicit tests: 'shows fee-unavailable warning when isError is true' 'does not show fee-unavailable warning when isError is false' • Fix six pre-existing broken tests that queried by raw i18n key names instead of resolved strings (amountLabel → 'Amount (XLM)', donateWithAmount → /donate N xlm/i, submittingTransaction → actual sentence, platformFeeNote → regex, etc.). • Update validation-error test to reflect actual component behaviour: inline validation sets aria-invalid but does not render a text error paragraph until form submission is attempted.
All 9 DonationModal tests pass; build is clean.
Summary
Closes #
Type of Change
Contributor Checklist
CONTRIBUTING.mdfor branch, commit, and PR title conventions.Validation
npm run lintnpm run format:checknpm run typechecknpm testnpm run buildNotes for Reviewers
closes #608