mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
add update comment jest test
This commit is contained in:
parent
a5f6390f97
commit
788979eedf
@ -37,7 +37,8 @@ const validateComment = async (resolve, root, args, context, info) => {
|
||||
if (!postId) {
|
||||
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 {
|
||||
|
||||
@ -175,4 +175,24 @@ describe('CreateComment', () => {
|
||||
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 () = {
|
||||
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user