mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
update acceptance tests helper to include version
This commit is contained in:
parent
f7e70e8228
commit
792c0135a0
1 changed files with 5 additions and 3 deletions
|
@ -12,7 +12,7 @@ module.exports = MockDocUpdaterApi =
|
||||||
getProjectStructureUpdates: (project_id) ->
|
getProjectStructureUpdates: (project_id) ->
|
||||||
@updates[project_id] || { docUpdates: [], fileUpdates: [] }
|
@updates[project_id] || { docUpdates: [], fileUpdates: [] }
|
||||||
|
|
||||||
addProjectStructureUpdates: (project_id, userId, docUpdates, fileUpdates) ->
|
addProjectStructureUpdates: (project_id, userId, docUpdates, fileUpdates, version) ->
|
||||||
@updates[project_id] ||= { docUpdates: [], fileUpdates: [] }
|
@updates[project_id] ||= { docUpdates: [], fileUpdates: [] }
|
||||||
|
|
||||||
for update in docUpdates
|
for update in docUpdates
|
||||||
|
@ -23,14 +23,16 @@ module.exports = MockDocUpdaterApi =
|
||||||
update.userId = userId
|
update.userId = userId
|
||||||
@updates[project_id].fileUpdates.push(update)
|
@updates[project_id].fileUpdates.push(update)
|
||||||
|
|
||||||
|
@updates[project_id].version = version
|
||||||
|
|
||||||
run: () ->
|
run: () ->
|
||||||
app.post "/project/:project_id/flush", (req, res, next) =>
|
app.post "/project/:project_id/flush", (req, res, next) =>
|
||||||
res.sendStatus 200
|
res.sendStatus 200
|
||||||
|
|
||||||
app.post "/project/:project_id", jsonParser, (req, res, next) =>
|
app.post "/project/:project_id", jsonParser, (req, res, next) =>
|
||||||
project_id = req.params.project_id
|
project_id = req.params.project_id
|
||||||
{userId, docUpdates, fileUpdates} = req.body
|
{userId, docUpdates, fileUpdates, version} = req.body
|
||||||
@addProjectStructureUpdates(project_id, userId, docUpdates, fileUpdates)
|
@addProjectStructureUpdates(project_id, userId, docUpdates, fileUpdates, version)
|
||||||
res.sendStatus 200
|
res.sendStatus 200
|
||||||
|
|
||||||
app.delete "/project/:project_id/doc/:doc_id", (req, res, next) =>
|
app.delete "/project/:project_id/doc/:doc_id", (req, res, next) =>
|
||||||
|
|
Loading…
Reference in a new issue