Tell us what’s happening:
Test 4 seems impossible to clear, as I can’t even send a POST request without required fields filled? Hard-coded to be required before a request is even sent? Or am I missing something?
###Your project link(s)
solution: https://3000-freecodecam-boilerplate-p2vb5tsy02s.ws-eu116.gitpod.io
githubLink: GitHub - SnowfallFox/fcc-issue-tracker: FreeCodeCamp issue tracker Project
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0
Challenge Information:
Quality Assurance Projects - Issue Tracker
Hey, no one can get to the solution after thirty mins on gitpod. I see you posted the boilerplate. Did you write any code?
Log out the three values (title, text, by) and submit. They are not what you think they are when the body content is missing.
it’s all in the github repo that was also linked
my issue is that i seemingly can’t log them, because if i do not fill out the required fields i just get this pop-up (in the image) and no POST request is sent. my console indicates the POST request is only sent once they are filled in already. I’m still not sure what i’m missing for this particular issue, unfortunately.
The API should work without a frontend. You can test it using a tool like Postman. If you let the tests run and hit the endpoints, you can also look at the request/response in the browser dev tools.
Just to be clear, the tests are not using the frontend, they access the routes directly using request methods. For example, for the POST, it will POST with (or without) a payload to the endpoint.
async (getUserInput) => {
try {
let test_data = { created_by: 'fCC' };
const data = await $.post(getUserInput('url') + '/api/issues/fcc-project', {
created_by: 'fCC'
});
assert.isObject(data);
assert.property(data, 'error');
assert.equal(data.error, 'required field(s) missing');
} catch (err) {
throw new Error(err.responseText || err.message);
}
};
The test are here if you want to see them
https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/06-quality-assurance/quality-assurance-projects/issue-tracker.md
Thank you for the responses! Up until now in the course I hadn’t really dealt with anything like this, so I hadn’t realised that the tests weren’t using the front-end. Postman seems like a useful tool, I will keep this one in mind! I wonder if it’s worth explicitly teaching something like that? Anyway thank you again!