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

[POST user endpoint] Not enough validations for fields: "lastName", "firstName" #86

Open
AlexandraPopovaz opened this issue May 30, 2023 · 0 comments
Assignees

Comments

@AlexandraPopovaz
Copy link
Collaborator

AlexandraPopovaz commented May 30, 2023

Steps to reproduce
Scenario 1: if "lastName" is a number
send a POST user request with data:
{ title: "should return an error if lastName is a number", role: "student" as Role, field: "lastName", value: 123, expected: 400, },
Actual behavior 200 code
Expected behavior 400 error code

Scenario 2: if "firstName" is an empty object
send a POST user request with data:
{ title: "should return an error if firstName is an empty object", role: "student" as Role, field: "firstName", value: {}, expected: 400, }
Actual behavior 500 code
Expected behavior 400 error code

Scenario 3: if "lastName" is an empty object
send a POST user request with data:
{ title: "should return an error if lastName is an empty object", role: "student" as Role, field: "lastName", value: {}, expected: 400, }
Actual behavior 500 code
Expected behavior 400 error code

Scenario 4: if "lastName" is an empty Array
send a POST user request with data:
{ title: "should return an error if lastName is an empty Array", role: "student" as Role, field: "lastName", value: [], expected: 400, }
Actual behavior 500 code
Expected behavior 400 error code

@viraxslot viraxslot self-assigned this May 30, 2023
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

No branches or pull requests

2 participants