Skip to content

feat: add client-side validation to toast inputs#672

Merged
mikewheeleer merged 1 commit into
Talenttrust:mainfrom
AbuJulaybeeb:feature/toast-12-validation
Jul 25, 2026
Merged

feat: add client-side validation to toast inputs#672
mikewheeleer merged 1 commit into
Talenttrust:mainfrom
AbuJulaybeeb:feature/toast-12-validation

Conversation

@AbuJulaybeeb

Copy link
Copy Markdown
Contributor

What was done

  • Converted ToastDemo into an interactive form with inputs for Title, Description, and Duration.
  • Implemented client-side validation rules (required fields, max length for strings, and numeric ranges).
  • Added accessible inline error messaging using the native FormField component (aria-describedby and role="alert").
  • Blocked form submission entirely when the input data is invalid.
  • Added comprehensive unit tests in toast-demo.test.tsx to guarantee robust validation coverage.

Why it was done
Previously, the toast inputs accepted invalid values silently. By adding robust client-side validation and accessible inline errors, we prevent layout-breaking toast notifications and provide users with immediate, accessible feedback when they input invalid data, fulfilling the requirements for issue #654.

How it was verified

  • Verified locally that empty inputs trigger an immediate inline error.
  • Verified that exceeding the character limit (50 for title, 200 for description) properly blocks submission.
  • Achieved passing tests covering all validation edge cases (empty, out-of-range, and valid submit) in src/components/toast/__tests__/toast-demo.test.tsx.
  • Ran npm run lint, npm test, and npm run build with full success and zero regressions.

Closes #654

- Converted ToastDemo into a form with Title, Description, and Duration inputs
- Added required and max-length constraints for toast attributes
- Implemented accessible inline errors using FormField (aria-describedby)
- Added dynamic client-side validation that blocks submission of invalid data
- Wrote tests to cover all validation paths and edge cases
@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@AbuJulaybeeb 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! 🚀

Learn more about application limits

@mikewheeleer

Copy link
Copy Markdown
Contributor

top work @AbuJulaybeeb — no notes. merging 🔥

@mikewheeleer
mikewheeleer merged commit b1d2ec9 into Talenttrust:main Jul 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add client-side validation and inline errors to the toast inputs

2 participants