ita-social-projects / StreetCode

MIT License
19 stars 9 forks source link

[API][Streetcode/Teaser/Text] It's possible to create a StreetCode without the required teaser and title/No character count validation #1144

Open DariaAntonenko opened 9 months ago

DariaAntonenko commented 9 months ago

Environment: All Reproducible: Always Build found: 46ca722

Preconditions

  1. Open Postman.
  2. Choose the POST/PUT method.
  3. Enter valid endpoints.
  4. Fill in all necessary fields in the request body.
Issue Steps to reproduce Actual result Expected result Status
1. Max count ["teaser"]
POST/PUT
Add text longer than 520 characters to the "teaser" key and click the 'Send' button. The Streetcode is created. The '400 Bad Request' status with "" message is returned in the response. Streetcode isn't created. (Admin can't create a Streetcode that contains more than 520 symbols in the "teaser" key. Fail
2. Mandatory ["teaser"]
POST/PUT
Send the request without a key in the "teaser" key (""). The Streetcode is created. The '400 Bad Request' status with "The "tester" key is mandatory" message is returned in the response. Streetcode isn't created. Fail
3. Max count ["text": "textContent"]
POST/PUT
Add more than 25,000 characters allowed in the "textContent" key, and click the 'Send' button. The Streetcode is created. The '400 Bad Request' status with "The "textContent" key" message is returned in the response. Streetcode isn't created. Fail
4. Max count ["text": "title"]
POST/PUT
Add more than 50 characters allowed in the "title" key, and click the 'Send' button. The Streetcode is created. The '400 Bad Request' status with "The "title" key" message is returned in the response. Streetcode isn't created. Fail
5. Max count ["text": "additionalText"]
POST/PUT
Add more than 200 characters allowed in the "additionalText" key, and click the 'Send' button. The Streetcode is created. The '400 Bad Request' status with "The "additionalText" key" message is returned in the response. Streetcode isn't created. Fail
6. Mandatory ["text": "title"]
PUT
Send the request with the "textContent", but without the "title" key. The Streetcode is created. The '400 Bad Request' status is returned in the response. Streetcode isn't created (The admin can't create the StreetCode with the main text but without the title). Fail

Actual result

  1. [Teaser] Screenshot_59 photo_5326025868612589296_y

User story and test case links User story #20 #122 #115 [Test Cases] #485

mozhaieva commented 1 month ago
  1. The Streetcode isn't created/updated with value empty key ("") in "title" - "message": "The 'title' key for the text is empty or missing."- 400 Bad Request
sashapanasiuk5 commented 3 weeks ago

Fixed in https://github.com/ita-social-projects/StreetCode/issues/308