Ticket: Create/Update Comments .test cases pass but UI Validation fails

Test cases pass but UI fails to generate validation code.

Also,
comments.controller.js ==>passes ‘movieId’ as an ObjectId to CommentsDAO.addComment()
whereas
create-update-comments.js ==>passes ‘movieId’ as a string to CommentsDAO.addComment()

After handling this case in add comment.I am able to pass the test cases but still UI Validation fails.

Is there any error message in console?

Kanika

Yes.following is the error:
PUT http://localhost:5000/api/v1/movies/comment 500 (Internal Server Error)
PUT http://localhost:5000/api/v1/movies/comment 500 (Internal Server Error)

there are total 3 api hits:
1 POST on http://localhost:5000/api/v1/movies/comment
and
2 PUT on http://localhost:5000/api/v1/movies/comment
but the PUT api fails with 500 Internal Server Error

Hi @Jay_96365,

Please check your messages.

Kanika

Hi @kanikasingla ,

I saw a similar question and it suggested to sort the comments in descending order.I tried that my UI validation is also passing.but didnt get why I should sort the comments.
But there is nowhere mentioned that I should sort the comments.

following is the link to that post:

Unless the course changed. You just missed it because part of the previous lab is

Task
Modify the getMovieByID method in moviesDAO.js so that it also fetches the comments for a given movie. The comments should be returned in order from most recent to least recent using the date key.

The part you missed is in bold. They do not catch the error in the unit test of the previous ticket.

1 Like