Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TextInput] Add a default max length based on input type #988

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

tanner-ricks
Copy link
Contributor

@tanner-ricks tanner-ricks commented Oct 4, 2024

Added overridable default max length to inputs across the application. This consisted of creating a wrapper component for accomplishing this. Additionally, added/updated e2e tests to verify the fuinctionality.

Changes

  • src
    • components
      • TextInput.tsx: Added this to work as a component wrapper for the design-system TextInput component. This way the character limit defaults can be enforced anywhere this component is used.
      • InputEntry.tsx: Updated this to use the new TextInput wrapper and pass relevant required fails.
    • pages
      • PointOfContact
        • index.tsx: Added relevant character limits that were different than the default
      • ProfileForm
        • CreateProfileForm
          • AddFinancialInstitution.tsx: Added relevant character limits that were different than the default
        • Step1Form
          • Step1FormInfoFieldGroup.tsx: Removed unnecessary character limits since there is now a default
      • types
        • formTypes.ts: Updated default character limits to new variable name
      • utils
        • constants.ts: Updated and created input character limit constants for use
  • e2e
    • pages
      • filing-app
        • complete-user-profile
          • checkCupFormErrors.spec.tsx: Added new test to verify character limits
        • point-of-contact
          • checkPocFormErrors.spec.tsx: Added new test to verify character limits
      • shared-lending-platform
        • NonAssociatedUserProfile.spec.tsx: Updated test to verify all character limits
        • UpdateInstitutionProfile.spec.tsx: Added test to verify character limits
    • utils
      • inputValidators.tsx: Added helper functions to unify input content validation

How to test this PR

  1. Pull 986-default-max-length in sbl-frontend
  2. Verify that TextInput.tsx in sbl-frontend has no errors
  3. Start the stack
  4. Run the e2e tests
  5. Verify that the e2e tests pass

@tanner-ricks tanner-ricks changed the title [TextInput] Add a default max length based on input type Draft: [TextInput] Add a default max length based on input type Oct 4, 2024
@tanner-ricks tanner-ricks linked an issue Oct 9, 2024 that may be closed by this pull request
@tanner-ricks tanner-ricks changed the title Draft: [TextInput] Add a default max length based on input type [TextInput] Add a default max length based on input type Oct 9, 2024
@tanner-ricks tanner-ricks marked this pull request as ready for review October 9, 2024 18:14
Copy link
Collaborator

@meissadia meissadia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please double check your tests? I'm getting consistent failures in the unicode and length tests:
Screenshot 2024-10-10 at 12 16 34 PM

@tanner-ricks
Copy link
Contributor Author

Can you please double check your tests? I'm getting consistent failures in the unicode and length tests: Screenshot 2024-10-10 at 12 16 34 PM

Can't reproduce and can't see the nature of the failures with the information given.

@shindigira
Copy link
Contributor

shindigira commented Oct 11, 2024

@meissadia @tanner-ricks I believe I partially broke the Complete User Profile (Non-Associated) page.

#995 should resolve at least for the two Complete your Profile (Non-Associated) tests.

EDIT: Tests (with #995 and this PR) are passing:

Screenshot 2024-10-11 at 2 02 18 PM

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.

[TextInput] Add a default max length based on input type
3 participants