mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Await relation be added
This commit is contained in:
parent
abbfc6d757
commit
cd5e492569
@ -328,15 +328,20 @@ describe('UpdatePost', () => {
|
|||||||
describe('post created without categories somehow', () => {
|
describe('post created without categories somehow', () => {
|
||||||
let ownerNode, owner, postMutationAction
|
let ownerNode, owner, postMutationAction
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
authorParams.id = 'author-of-post-without-category'
|
|
||||||
const postSomehowCreated = await instance.create('Post', {
|
const postSomehowCreated = await instance.create('Post', {
|
||||||
id: 'how-was-this-created',
|
id: 'how-was-this-created',
|
||||||
title: postTitle,
|
title: postTitle,
|
||||||
content: postContent,
|
content: postContent,
|
||||||
})
|
})
|
||||||
ownerNode = await instance.create('User', authorParams)
|
ownerNode = await instance.create('User', {
|
||||||
|
id: 'author-of-post-without-category',
|
||||||
|
name: 'Hacker',
|
||||||
|
slug: 'hacker',
|
||||||
|
email: 'hacker@example.org',
|
||||||
|
password: '1234',
|
||||||
|
})
|
||||||
owner = await ownerNode.toJson()
|
owner = await ownerNode.toJson()
|
||||||
postSomehowCreated.relateTo(ownerNode, 'author')
|
await postSomehowCreated.relateTo(ownerNode, 'author')
|
||||||
postMutationAction = async (user, mutation, variables) => {
|
postMutationAction = async (user, mutation, variables) => {
|
||||||
const { server } = createServer({
|
const { server } = createServer({
|
||||||
context: () => {
|
context: () => {
|
||||||
@ -358,7 +363,6 @@ describe('UpdatePost', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('throws an error if categoryIds is not an array', async () => {
|
it('throws an error if categoryIds is not an array', async () => {
|
||||||
updatePostVariables.categoryIds = null
|
|
||||||
const mustAddCategoryToPost = await postMutationAction(
|
const mustAddCategoryToPost = await postMutationAction(
|
||||||
owner,
|
owner,
|
||||||
updatePostMutation,
|
updatePostMutation,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user