Skip to content

Add Validation and write e2e tests covering all scenarios for the username generation flow during signup. #605

@Abhay5855

Description

@Abhay5855

Issue Description

During signup flow add appropriate validations and e2e tests for automatic generation of username from First Name and Last Name fields.

Expected Behavior

When user is in the signup flow, it should not allow blank spaces to be added in the first name and last name fields, Also the username must be atleast 4 character long for reference -
First Name - Abhay
Last Name - Patil
The generated username (if no Abhay patil was there before in the DB) - Abhay-Patil,
If some other user with same First Name and Last Name the generated username - Abhay-Patil-1

Current Behavior

Currently on the signup flow there is a username field, the username gets generated automatically after entering the first name and last name field, however if a blank space is added in the first name or last name field it accepts it and create an unusual username, and there is a restriction that username must be at leaast 4 characters long due to adding space in the first name and last name field the username does not get generated as expected.

Screenshots

Error when the username is less than 4 characters long

usernameerror

Error when blank space is added in the first name and last name fields

username2

Reproducibility

  • This issue is reproducible
  • This issue is not reproducible

Steps to Reproduce

  1. Visit the /new-signup route
  2. Add your First Name, Last Name and then Submit button.
  3. The username should be generated for you with your added First Name and Last Name.

Severity/Priority

  • Critical
  • High
  • Medium
  • Low

Additional Information

Writing/Reviewing good e2e tests to ensure the username generate flow works smoothly considering all scenarios like -

  1. The first name and last name field should not be blank.
  2. No Blank spaces should be allowed to be entered in the fields.
  3. User should not be allowed to enter the username manually it should be generated automatically.
  4. If user with similar full name gets added the username should be generated accordingly first_name-last_name, first_name-last_name-1, first_name-last_name-2 ...

Checklist

  • I have read and followed the project's code of conduct.
  • I have searched for similar issues before creating this one.
  • I have provided all the necessary information to understand and reproduce the issue.
  • I am willing to contribute to the resolution of this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions