ita-social-projects / StreetCode

MIT License
19 stars 9 forks source link

[Admin/StreetCode] [Video POST/PUT] There is no video URL validation; the admin can add not only a YouTube link #1363

Open SophiaMRI opened 7 months ago

SophiaMRI commented 7 months ago

Environment: All Reproducible: Always Build found: a7d807f

Preconditions

  1. Postman is open.
  2. The right method is chosen.
  3. Valid endpoints have been written.
  4. All required data has been added to the body.
Issue Steps to reproduce Actual result Expected result
[POST]
[Empty array]
1. Add an empty array to the video "url" key ( [ ] ).
2. Send the request.
The 200 status returned in the response.
The 'Unexpected Application Error!' message is on the front.
The '400 Bad Request' status, with the message 'The "url" video field is invalid,' is returned in the response.
[POST]
[Empty key]
1. Leave the video "url" key empty (" ").
2. Send the request.
The 200 status returned in the response.
The black disabled block in the video place is present on the front.
The '400 Bad Request' status, with the message 'The "url" video field is invalid,' is returned in the response.
[POST/PUT]
[Non-YouTube link]
1. Add a non-YouTube link in the URL key (e.g. "https:/ /www.wikipedia.com.ua").
2. Send the request.
The 200 status returned in the response.
The black disabled block in the video place is present on the front.
The '400 Bad Request' status, with the message 'The "url" video field is invalid,' is returned in the response.
[POST]
[Numbers]
1. Add numbers in the video "url" key (e.g. "1234").
2. Send the request.
The 200 status returned in the response.
The black disabled block in the video place is present on the front.
The '400 Bad Request' status, with the message 'The "url" video field is invalid,' is returned in the response.
[POST/PUT]
[Numbers&special characters]
1. Add numbers and special characters in the video "url" key (e.g. "12-34*%").
2. Send the request.
The 200 status returned in the response.
The black disabled block in the video place is present on the front.
The '400 Bad Request' status, with the message 'The "url" video field is invalid,' is returned in the response.
[POST/PUT]
[Letters]**
1. Add all required data in the body.
2. Add a some word in the URL key (e.g. "string").
2. Send the request.
The 200 status returned in the response.
The black disabled block in the video place is present on the front.
The '400 Bad Request' status, with the message 'The "url" video field is invalid,' is returned in the response.

User story and test case links User story #122 [Test case] #352

mozhaieva commented 1 month ago
  1. [POST][Empty array] - 200 OK, but there is no the 'Unexpected Application Error!' message is on the front
  2. [POST][Empty key] - 200 OK, but there is no the black disabled block in the video place present on the front
  3. [POST/PUT][Non-YouTube link] - 400 Bad Request, if there is non-youtube link the message appears: "The 'title' key for the video is empty or missing."
  4. [POST/PUT][Numbers&special characters] - 400 Bad Request, The message appears: "The 'title' key for the video is empty or missing."
  5. [POST/PUT][Letters] - 400 Bad Request, The message appears: "The 'title' key for the video is empty or missing."
sashapanasiuk5 commented 1 month ago

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