Exercise Tracker - 5th test : Unable to pass despite trying many things

@Sky020, I just read another post about the 5th test, and added || date === undefined to my ``` if (date === “”) condition for the date since:

OsakaStarbux said " I was so focussed on passing test 5 that I couldn’t see the real problem. In a perfect world the tests would only test one thing at a time but in this case test 5 bundles the exercise log and unexpected user input (for another route, not the log route). This is what fooled me. I spent ages guessing what the log output should look like when it was fine.

The real problem was the test setting up the user and exercises ready to be tested. After a user is created the test code hits the exercise/add route to create a log but one of those requests failed because the date parameter is undefined. You need to handle that or the log will not be what the test expects (the exercise doesn’t get created).

This is a little unfair since this can only fail because your form is not being used. The test actually builds a bad request because it can. Also, test 4 (for adding exercises) will pass leaving you with a false sense of security. I think the tests need fixing. I’ll have a go at that once I feel confident.
EDIT: I submitted a pull request for this issue:

github.com/freeCodeCamp/freeCodeCamp

Fix missing date parameter

freeCodeCamp:masterOsakaStarbux:master

opened Jul 15, 2020

OsakaStarbux OsakaStarbux

+2 -2 "

The link to the post I read:
Exercise Tracker, not sure why test 5 is not passing - JavaScript - The freeCodeCamp Forum