Skip to content
Snippets Groups Projects
Commit 0fb3fa14 authored by Sebastian's avatar Sebastian
Browse files

feat(component-invite): fix invite tests

parent 9314b8ae
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ module.exports = async (body, models, res, url) => {
return res.status(500).json({ error: e.details[0].message })
}
return userHelper.setupNewUser(
const newUser = await userHelper.setupNewUser(
body,
url,
res,
......@@ -35,5 +35,13 @@ module.exports = async (body, models, res, url) => {
models.User,
'invite',
)
if (newUser.error !== undefined) {
return res.status(newUser.status).json({
error: newUser.message,
})
}
return res.status(200).json(newUser)
}
}
......@@ -8,7 +8,7 @@ module.exports = {
title: 'Standard Collection',
type: 'collection',
fragments: [],
owners: [],
owners: [submittingAuthor.id],
save: jest.fn(),
assignedPeople: [
{
......
......@@ -15,4 +15,8 @@ module.exports = {
firstName: chance.first(),
lastName: chance.last(),
},
admin: {
id: chance.guid(),
email: chance.email(),
},
}
const { standardCollection } = require('./collections')
const { heTeamID, reviewerTeamID } = require('./teamIDs')
const { handlingEditor, submittingAuthor } = require('./userData')
const { handlingEditor, submittingAuthor, admin } = require('./userData')
const Chance = require('chance')
const chance = new Chance()
......@@ -8,10 +8,10 @@ const users = {
admin: {
type: 'user',
username: 'admin',
email: 'admin@example.com',
email: admin.email,
password: 'test',
admin: true,
id: 'admin123',
id: admin.id,
},
editorInChief: {
type: 'user',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment