From 56d88d6e84c93410e0ba6d5e5e5f16579c022991 Mon Sep 17 00:00:00 2001 From: aonomike Date: Wed, 9 Oct 2019 13:25:41 +0300 Subject: [PATCH] Resolve failing test --- backend/src/schema/resolvers/posts.js | 3 ++- backend/src/schema/resolvers/posts.spec.js | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/schema/resolvers/posts.js b/backend/src/schema/resolvers/posts.js index 4b3c11413..79d3105af 100644 --- a/backend/src/schema/resolvers/posts.js +++ b/backend/src/schema/resolvers/posts.js @@ -97,7 +97,8 @@ export default { ` } - createPostCypher += `UNWIND $categoryIds AS categoryId + createPostCypher += ` + UNWIND $categoryIds AS categoryId MATCH (category:Category {id: categoryId}) MERGE (post)-[:CATEGORIZED]->(category) RETURN post` diff --git a/backend/src/schema/resolvers/posts.spec.js b/backend/src/schema/resolvers/posts.spec.js index 919454b64..f70df708f 100644 --- a/backend/src/schema/resolvers/posts.spec.js +++ b/backend/src/schema/resolvers/posts.spec.js @@ -282,7 +282,10 @@ describe('CreatePost', () => { }) it('creates a post', async () => { - const expected = { data: { CreatePost: { title: 'I am a title', content: 'Some content' } } } + const expected = { + data: { CreatePost: { title: 'I am a title', content: 'Some content' } }, + errors: undefined, + } await expect(mutate({ mutation: createPostMutation, variables })).resolves.toMatchObject( expected, ) @@ -298,6 +301,7 @@ describe('CreatePost', () => { }, }, }, + errors: undefined, } await expect(mutate({ mutation: createPostMutation, variables })).resolves.toMatchObject( expected,