mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 04:06:39 -05:00
Fix FileStore unit tests
This commit is contained in:
parent
bad9a0282d
commit
a95c941cb9
1 changed files with 7 additions and 1 deletions
|
@ -19,7 +19,7 @@ describe "FileStoreHandler", ->
|
||||||
on: (type, cb)->
|
on: (type, cb)->
|
||||||
if type == "end"
|
if type == "end"
|
||||||
cb()
|
cb()
|
||||||
@readStream = {my:"readStream"}
|
@readStream = {my:"readStream", on: sinon.stub()}
|
||||||
@request = sinon.stub()
|
@request = sinon.stub()
|
||||||
@settings = apis:{filestore:{url:"http//filestore.sharelatex.test"}}
|
@settings = apis:{filestore:{url:"http//filestore.sharelatex.test"}}
|
||||||
@handler = SandboxedModule.require modulePath, requires:
|
@handler = SandboxedModule.require modulePath, requires:
|
||||||
|
@ -128,6 +128,12 @@ describe "FileStoreHandler", ->
|
||||||
@handler.getFileStream @project_id, @file_id, {}, (err, stream)=>
|
@handler.getFileStream @project_id, @file_id, {}, (err, stream)=>
|
||||||
@handler._buildUrl.calledWith(@project_id, @file_id).should.equal true
|
@handler._buildUrl.calledWith(@project_id, @file_id).should.equal true
|
||||||
done()
|
done()
|
||||||
|
|
||||||
|
it "should add an error handler", (done) ->
|
||||||
|
@handler.getFileStream @project_id, @file_id, {}, (err, stream)=>
|
||||||
|
stream.on.calledWith("error").should.equal true
|
||||||
|
done()
|
||||||
|
|
||||||
|
|
||||||
describe "copyFile", ->
|
describe "copyFile", ->
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue