That’s because your POST route is returning undefined for the ID on that test.
You should log all the route inputs and responses from both routes to track what happens in your code as you run the tests. Doing this, you will find that a valid URL is marked as invalid. To correct the problem, this bit of documentation may be helpful; you will need to very slightly restructure your code.