Merge branches 'jpa-prepare-for-matrix-tests' and 'jpa-setup-session-helper' into jpa-matrix-tests

This commit is contained in:
Jakob Ackermann 2020-10-01 12:57:40 +01:00
commit 4ec73acb88
3 changed files with 21 additions and 1 deletions

View file

@ -109,6 +109,22 @@ module.exports = FixturesManager = {
})
},
setUpEditorSession(options, callback) {
FixturesManager.setUpProject(options, (err, detailsProject) => {
if (err) return callback(err)
FixturesManager.setUpDoc(
detailsProject.project_id,
options,
(err, detailsDoc) => {
if (err) return callback(err)
callback(null, Object.assign({}, detailsProject, detailsDoc))
}
)
})
},
getRandomId() {
return require('crypto')
.createHash('sha1')

View file

@ -43,6 +43,9 @@ module.exports = MockDocUpdaterServer = {
if (error != null) {
return next(error)
}
if (!data) {
return res.sendStatus(404)
}
return res.json(data)
}
)

View file

@ -31,7 +31,8 @@ module.exports = MockWebServer = {
return callback(
null,
MockWebServer.projects[project_id],
MockWebServer.privileges[project_id][user_id]
MockWebServer.privileges[project_id][user_id] ||
MockWebServer.privileges[project_id]['anonymous-user']
)
},