Repository navigation
Conversation
Adds 6 test files under frontend/src/components/ui/__tests__/: Button.test.tsx (25 tests) - default type=button, variant classes, primary default - disabled prop: aria-disabled, no click - isLoading: disabled, aria-busy, spinner shown, icons hidden - leftIcon/rightIcon visible when not loading - ref forwarding, className merge Card.test.tsx (17 tests) - renders children, base class, className merge, attribute forwarding - interactive: ui-card--interactive class applied/absent - noPadding: ui-card--no-padding class applied/absent - CardHeader/CardTitle(as prop)/CardBody/CardFooter classes and rendering - ref forwarding, full composition test Select.test.tsx (22 tests) - renders select + options, caller-supplied id respected - label/htmlFor association, required asterisk, hint text - error: role=alert, aria-invalid, aria-describedby (error only / hint+error) - aria-describedby absent when no hint/error - user selection interaction, ref forwarding TextInput.test.tsx (21 tests) - renders input, label/htmlFor, id override, required asterisk, hint - error: role=alert, aria-invalid, ui-input--error class, aria-describedby - hint+error both in aria-describedby, absent when neither present - user input, attribute forwarding, ref forwarding Textarea.test.tsx (21 tests) - same pattern as TextInput plus rows=4 default and custom rows value - ui-textarea--error class, ref forwarding Modal.test.tsx (28 tests) - returns null when open=false, renders when open=true - title, description, children, footer slot, close button visibility - aria-modal, aria-labelledby, aria-describedby wiring - close via button, backdrop, Escape key; all disable* flags - disableBackdropDismiss=true: no close on backdrop, no close button - body scroll lock on open, restored on close and unmount - first focusable focused after setTimeout(0); prev focus restored on close - Tab/Shift+Tab focus trap; removeEventListener on close and unmount All 134 tests pass. No config changes needed.
|
@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 #1583.
Adds 134 tests across 6 new files under
frontend/src/components/ui/__tests__/, one per primitive. No config changes needed — Jest picks them up automatically.Coverage per primitive
type=button, variant classes,isLoading(disabled +aria-busy+ spinner + icons hidden),disabledprop,leftIcon/rightIcon, ref forwardinginteractive/noPaddingmodifier classes,CardHeader/CardTitle(asprop) /CardBody/CardFooter, composition, ref forwardinghtmlFor, auto-generated vs caller-supplied id, required asterisk, hint text, error inrole=alert,aria-invalid,aria-describedby(error only / hint+error / absent), user selection, ref forwardingui-input--errorclass, user input, attribute forwarding, ref forwardingrows=4default, custom rows,ui-textarea--errorclass, ref forwardingopengate, title/description/children/footer slot,aria-modal/aria-labelledby/aria-describedby, close via button / backdrop / Escape, alldisable*flags, body scroll lock, first-focusable focus aftersetTimeout(0), previous-focus restore on close, Tab/Shift+Tab focus trap,removeEventListenercleanupTest results
No regressions introduced (pre-existing failures in the broader suite are unrelated vitest/module-alias issues in other files).