mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
test default label Article for postType property on create post
This commit is contained in:
parent
a67482b94f
commit
507fa4c352
@ -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 },
|
||||
)
|
||||
|
||||
@ -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'] } },
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user