Information Security Projects - Anonymous Message Board. Tests not passing

Tell us what’s happening:
When I run the tests using Replit, tests 5, 6, 10, 11 and 12 do not pass. When I run them in localhost, only test 11 (PUT request to report thread) does not pass, but it must be bugged , since my functionality is good when I test it on my own.

Your project link(s)

solution: boilerplate-project-messageboard - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36

Challenge: Information Security Projects - Anonymous Message Board

Link to the challenge:

.repl.co refused to connect.

Are you sure you have the correct id in the PUT request?

Look at the payload in the network tab for the PUT request.


You linked to the wrong Replit

https://replit.com/@GuillermoCzza/boilerplate-project-messageboard

It is beyond me how I managed to link the wrong Replit, but the test results I mentioned in my post are indeed the ones I got with the anonymous message board project (I re-checked just in case).

Regarding the payload, the “report_id” field’s value seems to be the correct one, and looking at the changes in my MongoDB Atlas confirms that to be the case.

This is the test your code fails locally

You can send a PUT request to /api/threads/{board} and pass along the thread_id . Returned will be the string reported . The reported value of the thread_id will be changed to true .


Are you sure you are looking at the correct PUT request?

Request URL: http://localhost:3000/api/threads/fcc_test

Payload:

{
  "thread_id": "64248ec9872f6f027d5f69ee"
}
1 Like

You’re correct. For some reason the tests send the id to report as a “thread_id” field, but the provided webpage sends them as a “report_id”. I was only looking for “report _id”, which is why it worked in my own tests but not in fCC’s. I changed it and now all tests pass on localhost, thanks.

Replit is still failing tests 5, 6, 10, 12. I tried using CodeSandbox instead, and the exact same tests failed. Could this be a problem that stems from my code?

I still can’t figure this out. The errors I get when trying to submit the Replit-hosted solution are these:

Why does it “fail to fetch” in Replit but not in my own computer, where all tests are passing?

1 Like