test default label Article for postType property on create post

This commit is contained in:
Moriz Wahl 2023-03-29 16:36:08 +02:00
parent a67482b94f
commit 507fa4c352
2 changed files with 8 additions and 1 deletions

View File

@ -131,7 +131,7 @@ export default {
MERGE (post)<-[:WROTE]-(author)
${categoriesCypher}
${groupCypher}
RETURN post {.*}
RETURN post {.*, postType: filter(l IN labels(post) WHERE NOT l = "Post") }
`,
{ userId: context.user.id, categoryIds, groupId, params },
)

View File

@ -34,6 +34,7 @@ const createPostMutation = gql`
author {
name
}
postType
}
}
`
@ -324,6 +325,12 @@ describe('CreatePost', () => {
expected,
)
})
it('has label "Article" as default', async () => {
await expect(mutate({ mutation: createPostMutation, variables })).resolves.toMatchObject({
data: { CreatePost: { postType: ['Article'] } },
})
})
})
})