mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge branches 'jpa-prepare-for-matrix-tests' and 'jpa-setup-session-helper' into jpa-matrix-tests
This commit is contained in:
commit
4ec73acb88
3 changed files with 21 additions and 1 deletions
|
@ -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')
|
||||
|
|
|
@ -43,6 +43,9 @@ module.exports = MockDocUpdaterServer = {
|
|||
if (error != null) {
|
||||
return next(error)
|
||||
}
|
||||
if (!data) {
|
||||
return res.sendStatus(404)
|
||||
}
|
||||
return res.json(data)
|
||||
}
|
||||
)
|
||||
|
|
|
@ -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']
|
||||
)
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue