Issue Tracker project - GET route test not passing

Tell us what’s happening:

Hello everyone,

I’m having a problem with the Issue Tracker project, which I don’t understand. I’m passing all tests (except for the functional tests that I’ll do once the rest is set up) except for the 5th, which is:

You can send a GET request to /api/issues/{projectname} for an array of all issues for that specific projectname , with all the fields present for each issue.

When I test the route, it seems that I’m correctly retrieving a list of issues in an array though… Plus, I’m passing the second requirement for the GET route.

Really don’t understand why I’m not passing this test. The GET route is the most simple of all. Any idea ?

Thanks a lot !

Your project link(s)

solution: boilerplate-project-issuetracker - Replit

Your browser information:

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

Challenge Information:

Quality Assurance Projects - Issue Tracker

Looks like your response is missing the assigned_to property.

Hey thanks for helping out. When I visit https://boilerplate-project-issuetracker.yan28.repl.co/api/issues/fcc-project for example, the assigned_to property is returned as well:

The assert message is logged in the browser console.

Error: expected { …(8) } to have property ‘assigned_to’

You can also check the first GET response after the first 6 POSTs using the browser dev tools (the network tab)

[
    {
        "_id": "6542bcb70680d11cd05fb050",
        "issue_title": "Faux Issue 1",
        "issue_text": "Get Issues Test",
        "created_on": "2023-11-01T20:52:57.151Z",
        "created_by": "fCC",
        "open": true,
        "project": "get_issues_test_500965",
        "__v": 0
    },
    {
        "_id": "6542bcb70680d11cd05fb052",
        "issue_title": "Faux Issue 2",
        "issue_text": "Get Issues Test",
        "created_on": "2023-11-01T20:52:57.151Z",
        "created_by": "fCC",
        "open": true,
        "project": "get_issues_test_500965",
        "__v": 0
    },
    {
        "_id": "6542bcb70680d11cd05fb054",
        "issue_title": "Faux Issue 3",
        "issue_text": "Get Issues Test",
        "created_on": "2023-11-01T20:52:57.151Z",
        "created_by": "fCC",
        "open": true,
        "project": "get_issues_test_500965",
        "__v": 0
    }
]

The tests if you are curious:

https://github.com/freeCodeCamp/freeCodeCamp/blob/3b25ed538baf93b361f277ba90225728e6c7df73/curriculum/challenges/english/06-quality-assurance/quality-assurance-projects/issue-tracker.md

1 Like

Thanks for the clarification. Really don’t understand why some issues would have their assigned_to property not returned. Seems to work well when I use the app manually. Will keep looking into it and update when solution is found…

Problem solved !

It came from my post route, where I wasn’t handling to possibility that assigned_to and status_text may not be provided. Just used a simple || to give these field an empty string value in this case. Also added updated_on as an emprty string as at the time of creation, it shouldn’t have a proper date value.

Now all tests are passing.

Thanks a lot @lasjorg for orienting me towards where the problem was.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.