mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
fixed unit tests for deleting files sent from tpds
This commit is contained in:
parent
396644d314
commit
7a46b98c82
1 changed files with 4 additions and 1 deletions
|
@ -11,7 +11,8 @@ describe 'UpdateMerger :', ->
|
||||||
@updateReciver = {}
|
@updateReciver = {}
|
||||||
@projectLocator = {}
|
@projectLocator = {}
|
||||||
@projectEntityHandler = {}
|
@projectEntityHandler = {}
|
||||||
@fs = {}
|
@fs =
|
||||||
|
unlink:sinon.stub().callsArgWith(1)
|
||||||
@FileTypeManager = {}
|
@FileTypeManager = {}
|
||||||
@updateMerger = SandboxedModule.require modulePath, requires:
|
@updateMerger = SandboxedModule.require modulePath, requires:
|
||||||
'../Editor/EditorController': @editorController
|
'../Editor/EditorController': @editorController
|
||||||
|
@ -50,6 +51,7 @@ describe 'UpdateMerger :', ->
|
||||||
@updateMerger.mergeUpdate @project_id, filePath, @update, @source, =>
|
@updateMerger.mergeUpdate @project_id, filePath, @update, @source, =>
|
||||||
@FileTypeManager.isBinary.calledWith(filePath, @fsPath).should.equal true
|
@FileTypeManager.isBinary.calledWith(filePath, @fsPath).should.equal true
|
||||||
@updateMerger.p.processDoc.calledWith(@project_id, doc_id, @fsPath, filePath, @source).should.equal true
|
@updateMerger.p.processDoc.calledWith(@project_id, doc_id, @fsPath, filePath, @source).should.equal true
|
||||||
|
@fs.unlink.calledWith(@fsPath).should.equal true
|
||||||
done()
|
done()
|
||||||
|
|
||||||
it 'should process update as file when it is not a doc', (done)->
|
it 'should process update as file when it is not a doc', (done)->
|
||||||
|
@ -62,6 +64,7 @@ describe 'UpdateMerger :', ->
|
||||||
@updateMerger.mergeUpdate @project_id, filePath, @update, @source, =>
|
@updateMerger.mergeUpdate @project_id, filePath, @update, @source, =>
|
||||||
@updateMerger.p.processFile.calledWith(@project_id, file_id, @fsPath, filePath, @source).should.equal true
|
@updateMerger.p.processFile.calledWith(@project_id, file_id, @fsPath, filePath, @source).should.equal true
|
||||||
@FileTypeManager.isBinary.calledWith(filePath, @fsPath).should.equal true
|
@FileTypeManager.isBinary.calledWith(filePath, @fsPath).should.equal true
|
||||||
|
@fs.unlink.calledWith(@fsPath).should.equal true
|
||||||
done()
|
done()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue