Scaffold some tests for disabledBy relation

This commit is contained in:
Robert Schäfer 2019-03-05 16:15:31 +01:00
parent f644507e4f
commit 420ea8a4d6
2 changed files with 47 additions and 0 deletions

View File

@ -200,3 +200,49 @@ describe('DeletePost', () => {
})
})
})
describe('AddPostDisabledBy', () => {
const mutation = `
mutation {
AddPostDisabledBy(from: { id: "u8" }, to: { id: "p9" }) {
from {
id
}
to {
id
}
}
}
`
it.todo('throws authorization error')
describe('authenticated', () => {
it.todo('throws authorization error')
describe('as moderator', () => {
it.todo('throws authorization error')
describe('current user matches provided user', () => {
it.todo('sets current user')
it.todo('updates .disabled on post')
})
})
})
})
describe('RemovePostDisabledBy', () => {
it.todo('throws authorization error')
describe('authenticated', () => {
it.todo('throws authorization error')
describe('as moderator', () => {
it.todo('throws authorization error')
describe('current user matches provided user', () => {
it.todo('sets current user')
it.todo('updates .disabled on post')
})
})
})
})

View File

@ -133,6 +133,7 @@ type Post {
visibility: VisibilityEnum
deleted: Boolean
disabled: Boolean
disabledBy: User! @relation(name: "DISABLED", direction: "IN")
createdAt: String
updatedAt: String