Skip to content

Conversation

@CamCode9
Copy link
Owner

Successfully implemented patch votes by article id - handling for 404 and 400

Copy link

@Rosem10 Rosem10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add those couple of tests that I've outlined in the comments.

exports.selectAllTopics = () => {
return db.query(`SELECT * FROM topics`).then((result) => {
return db.query(`SELECT * FROM topics;`).then((result) => {
console.log(result.rows);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove console.log please!

},
});
});
test("400: empty patch object returns bad request", async () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test for an article id of the wrong type - e.g. /api/articles/banana.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also for { inc_votes: banana } (again, wrong type)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants