Implemented review comments - moved new tests in their own 'it' blocks.

This commit is contained in:
Kapil Jain 2019-10-20 10:52:20 -04:00
parent dad9626656
commit 58e3429c31
2 changed files with 16 additions and 2 deletions

View File

@ -129,8 +129,18 @@ describe('follow', () => {
data: { followUser: expectedUser },
errors: undefined,
})
})
// Test to make sure FOLLOWS relationship has "createdAt" date.
test('adds `createdAt` to `FOLLOW` relationship', async () => {
const expectedUser = {
name: user2.name,
followedBy: [{ id: user1.id, name: user1.name }],
followedByCurrentUser: true,
}
await mutate({
mutation: mutationFollowUser,
variables,
})
const relation = await neode.cypher(
'MATCH (user:User {id: {id}})-[relationship:FOLLOWS]->(followed:User) WHERE relationship.createdAt IS NOT NULL RETURN relationship',
{ id: 'u1' },

View File

@ -100,7 +100,11 @@ describe('shout and unshout posts', () => {
data: { Post: [{ id: 'another-user-post-id', shoutedBy: [{ id: 'current-user-id' }] }] },
errors: undefined,
})
// Test to make sure SHOUT relationship has "createdAt" date.
})
it('adds `createdAt` to `SHOUT` relationship', async () => {
variables = { id: 'another-user-post-id' }
await mutate({ mutation: mutationShoutPost, variables })
const relation = await instance.cypher(
'MATCH (user:User {id: $userId1})-[relationship:SHOUTED]->(node {id: $userId2}) WHERE relationship.createdAt IS NOT NULL RETURN relationship',
{