ita-social-projects / SpaceToStudy-BackEnd

MIT License
13 stars 5 forks source link

[API] The user can save invalid parameters with spacial characters as First name/Last name #994

Closed YuliaHurska closed 6 days ago

YuliaHurska commented 6 days ago

Environment:

  1. OS - Windows 10 IoT Enterprise LTSC
  2. Browser - Chrome 130.0.6723.117

Reproducible: always.

Precondition:

  1. The site Space2Study is opened.
  2. The user is logged in
  3. The Postman app is opened
  4. The user's access token is available and added to the Postman headers.

Steps to Reproduce

  1. Choose the PATCH method in Postman.
  2. Add the endpoint {server}/users/{user_id} in the URL field, replacing {server} with the actual server address and {user_id} with the user's ID.
  3. In the Body tab, select the raw type and set the data format to JSON.
  4. Enter the following test data in the body: { "firstName": "@nn@", "lastName": "Map!a" }
  5. Send the request.

Actual Result: Status code 204 No Content is returned. The user's information is updated successfully in the system, but no content is returned in the response body.

Expected Result: Status code 400 Bad Request is returned. The system rejects the update because the test data (firstName and lastName containing numeric values) violates the validation rules for the user's information.

User story -#2693

luiqor commented 6 days ago

Planned to be fixed as part of issue ticket #998