mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-18 19:01:24 +00:00
Sketch test for #1054
This commit is contained in:
parent
5c0432d855
commit
6950068a12
44
backend/src/schema/resolvers/users/blockedUsers.spec.js
Normal file
44
backend/src/schema/resolvers/users/blockedUsers.spec.js
Normal file
@ -0,0 +1,44 @@
|
||||
import { createTestClient } from 'apollo-server-testing'
|
||||
import createServer from '../../../server'
|
||||
import { gql } from '../../../jest/helpers'
|
||||
|
||||
describe('blockedUsers', () => {
|
||||
it.todo('throws permission error')
|
||||
|
||||
describe('authenticated', () => {
|
||||
it.todo('returns a list of blocked users')
|
||||
})
|
||||
})
|
||||
|
||||
describe('block', () => {
|
||||
it.todo('throws permission error')
|
||||
|
||||
describe('authenticated', () => {
|
||||
it.todo('throws argument error')
|
||||
|
||||
describe('given a to-be-blocked user', () => {
|
||||
it.todo('blocks a user')
|
||||
|
||||
describe('blocked user writes a post', () => {
|
||||
it.todo('disappears in the newsfeed of the current user')
|
||||
})
|
||||
|
||||
describe('current user writes a post', () => {
|
||||
it.todo('disappears in the newsfeed of the blocked user')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('unblock', () => {
|
||||
it.todo('throws permission error')
|
||||
describe('authenticated', () => {
|
||||
it.todo('throws argument error')
|
||||
describe('given a blocked user', () => {
|
||||
it.todo('unblocks a user')
|
||||
describe('unblocking twice', () => {
|
||||
it.todo('has no effect')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -42,6 +42,12 @@ type User {
|
||||
RETURN COUNT(u) >= 1
|
||||
"""
|
||||
)
|
||||
isBlocked: Boolean! @cypher(
|
||||
statement: """
|
||||
MATCH (this)-[:BLOCKED]->(u:User {id: $cypherParams.currentUserId})
|
||||
RETURN COUNT(u) >= 1
|
||||
"""
|
||||
)
|
||||
|
||||
#contributions: [WrittenPost]!
|
||||
#contributions2(first: Int = 10, offset: Int = 0): [WrittenPost2]!
|
||||
@ -164,4 +170,9 @@ type Mutation {
|
||||
): User
|
||||
|
||||
DeleteUser(id: ID!, resource: [Deletable]): User
|
||||
|
||||
|
||||
block(id: ID!): User
|
||||
unblock(id: ID!): User
|
||||
blockedUsers: [User]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user