mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
All tests are passing!
This commit is contained in:
parent
c30548d1e8
commit
bfc5603fa8
@ -16,7 +16,7 @@ const isUniqueFor = (context, type) => {
|
|||||||
export default {
|
export default {
|
||||||
Mutation: {
|
Mutation: {
|
||||||
CreatePost: async (resolve, root, args, context, info) => {
|
CreatePost: async (resolve, root, args, context, info) => {
|
||||||
args.slug = await uniqueSlug(args.title, isUniqueFor(context, 'Post'))
|
args.slug = args.slug || await uniqueSlug(args.title, isUniqueFor(context, 'Post'))
|
||||||
const result = await resolve(root, args, context, info)
|
const result = await resolve(root, args, context, info)
|
||||||
return result
|
return result
|
||||||
},
|
},
|
||||||
|
|||||||
@ -53,7 +53,7 @@ describe('slugify', () => {
|
|||||||
slug: "pre-existing-post"
|
slug: "pre-existing-post"
|
||||||
) { slug }
|
) { slug }
|
||||||
}`)
|
}`)
|
||||||
).rejects.toThrow('Unique constraint error')
|
).rejects.toThrow('already exists')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user