mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-20 20:01:22 +00:00
Implemented review comments - moved new tests in their own 'it' blocks.
This commit is contained in:
parent
dad9626656
commit
58e3429c31
@ -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' },
|
||||
|
||||
@ -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',
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user