add update comment jest test

This commit is contained in:
ALau2088 2019-06-05 18:12:22 -07:00
parent a5f6390f97
commit 788979eedf
2 changed files with 22 additions and 1 deletions

View File

@ -37,7 +37,8 @@ const validateComment = async (resolve, root, args, context, info) => {
if (!postId) { if (!postId) {
throw new UserInputError(NO_POST_ERR_MESSAGE) throw new UserInputError(NO_POST_ERR_MESSAGE)
} }
return resolve(root, args, context, info) /* eslint-disable-next-line no-return-await */
return await resolve(root, args, context, info)
} }
export default { export default {

View File

@ -175,4 +175,24 @@ describe('CreateComment', () => {
expect(Comment).toEqual([{ postId: null }]) expect(Comment).toEqual([{ postId: null }])
}) })
}) })
describe('UpdateComment', () => {
const updateCommentMutation = `
mutation($postId: ID, $content: String!, $id: ID!) {
UpdateComment(postId: $postId, content: $content, id: $id) {
id
content
}
}
`
updateCommentVariables = {
postId: 'p1',
content: 'Comment is updated',
id: 'c8'
}
it('updates a comment', async () = {
})
})
}) })