mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Add acceptance test for the project-list and project-entities endpoints
This commit is contained in:
parent
f5dd94ca1d
commit
78f87c0ecf
1 changed files with 37 additions and 0 deletions
|
@ -56,8 +56,45 @@ describe "LinkedFiles", ->
|
|||
(error, doc_id) =>
|
||||
@source_doc_id = doc_id
|
||||
cb(error)
|
||||
(cb) =>
|
||||
@owner.createDocInProject @project_two_id,
|
||||
@project_two_root_folder_id,
|
||||
'some-harmless-doc.txt',
|
||||
(error, doc_id) =>
|
||||
cb(error)
|
||||
], done
|
||||
|
||||
it 'should produce a list of the users projects', (done) ->
|
||||
@owner.request.get {
|
||||
url: "/user/projects",
|
||||
json: true
|
||||
}, (err, response, body) =>
|
||||
expect(err).to.not.exist
|
||||
expect(body).to.deep.equal {
|
||||
projects: [
|
||||
{ _id: @project_one_id, name: 'plf-test-one', accessLevel: 'owner' },
|
||||
{ _id: @project_two_id, name: 'plf-test-two', accessLevel: 'owner' }
|
||||
]
|
||||
}
|
||||
done()
|
||||
|
||||
it 'should produce a list of entities in the project', (done) ->
|
||||
@owner.request.get {
|
||||
url: "/project/#{@project_two_id}/entities",
|
||||
json: true
|
||||
}, (err, response, body) =>
|
||||
expect(err).to.not.exist
|
||||
expect(body).to.deep.equal {
|
||||
project_id: @project_two_id,
|
||||
entities: [
|
||||
{ path: '/main.tex', type: 'doc' },
|
||||
{ path: '/some-harmless-doc.txt', type: 'doc' },
|
||||
{ path: '/test.txt', type: 'doc' }
|
||||
]
|
||||
}
|
||||
done()
|
||||
|
||||
|
||||
it 'should import a file from the source project', (done) ->
|
||||
@owner.request.post {
|
||||
url: "/project/#{@project_one_id}/linked_file",
|
||||
|
|
Loading…
Reference in a new issue