Repository navigation
Conversation
…ion, and balance Covers all four acceptance criteria from issue solutions-plug#1581: - No wallet connected → wallet.connect() is called, placeBet is not - Client-side validation: missing/zero/negative/NaN amount show errors - Successful submit: api.placeBet called with correct args, tx status shown via role=status, onSubmitted callback fires with txHash/outcome/amount - Insufficient balance: fetchNativeBalance called fresh on failure, INSUFFICIENT_BALANCE_MESSAGE + live balance rendered in alert; null balance falls back to 'unavailable' All modules (useWallet, api, fetchNativeBalance) are mocked — no network traffic in tests.
… primitives Form.test.tsx (442 lines) covers: - Form container: noValidate, onSubmit, className merging, attribute forwarding - FormField: label/htmlFor association, required marker, hint text, error message in role=alert, has-error class, children - Input/Textarea/Select: aria-invalid, aria-describedby on error, ref forwarding, default rows (Textarea) - Button: variants, isLoading disables + hides icons, fullWidth class, onClick blocked when loading, ref forwarding - StatusAlert: role=alert for error type, role=status for others, onDismiss button, children - Integration: validation error display + clear cycle, loading state, success alert after submit Modal.test.tsx (336 lines) covers: - Rendering: isOpen gate, title, description, aria-modal, aria-labelledby, aria-describedby, close button visibility with disableBackdropDismiss - Open/close: close button click, backdrop click, Esc key, all disable flag combinations, unmount on isOpen→false - Body scroll lock: overflow=hidden on open, restored on close/unmount - Focus management: first focusable focused after 50ms timeout, previous element restored on close, Tab wrap-to-first, Shift+Tab wrap-to-last - Cleanup: removeEventListener called on close and unmount
|
@wendyamoni-creator 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! 🚀 |
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 #1582.
admin/Form.tsxandadmin/Modal.tsxhad no test coverage. This PR adds two new test files underfrontend/src/components/admin/__tests__/with 79 tests covering all acceptance criteria.What's tested
Form.test.tsx (442 lines)
FormcontainernoValidate,onSubmit, className merging, attribute forwardingFormFieldhtmlForassociation, required*marker, hint text,role=alerterror message,has-errorclassInputaria-invalid,aria-describedbyon error, ref forwarding, user inputTextarearows=4, ref forwardingSelectaria-invalid,aria-describedby, ref forwardingButtonisLoadingdisables button + hides icons,fullWidth, onClick blocked when loading, ref forwardingStatusAlertrole=alertfor error type,role=statusfor others, dismiss button, childrenModal.test.tsx (336 lines)
isOpengate, title, description,aria-modal,aria-labelledby,aria-describedby, close button visibilitydisable*flag combinations,isOpen→falseunmountoverflow=hiddenon open, restored on close and unmountremoveEventListenercalled on both close and unmountTest results
No regressions in the broader suite (pre-existing failures are unrelated vitest/module-alias issues in other files). closes #1582