diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-11-10 09:50:46 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-11-13 08:46:35 +0100 |
commit | ae0a496da83613dc8b41540f2fa32479a3ec3f07 (patch) | |
tree | 494fdf6e463a0691356b41d154d2cc7b8881168f /apps/files/tests/js/fileUploadSpec.js | |
parent | 25f8d76f266d53fa4b6f0f3c4fa65febc7b31253 (diff) | |
download | nextcloud-server-ae0a496da83613dc8b41540f2fa32479a3ec3f07.tar.gz nextcloud-server-ae0a496da83613dc8b41540f2fa32479a3ec3f07.zip |
Bump jquery from 2.2.4 to 3.1.0
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files/tests/js/fileUploadSpec.js')
-rw-r--r-- | apps/files/tests/js/fileUploadSpec.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/apps/files/tests/js/fileUploadSpec.js b/apps/files/tests/js/fileUploadSpec.js index b7955f3b837..64006d71e42 100644 --- a/apps/files/tests/js/fileUploadSpec.js +++ b/apps/files/tests/js/fileUploadSpec.js @@ -123,6 +123,7 @@ describe('OC.Upload tests', function() { }); describe('Upload conflicts', function() { var conflictDialogStub; + var clock; var fileList; beforeEach(function() { @@ -162,6 +163,11 @@ describe('OC.Upload tests', function() { deferred.resolve(); }); afterEach(function() { + if (clock) { + clock.restore(); + clock = undefined + } + conflictDialogStub.restore(); fileList.destroy(); @@ -210,7 +216,7 @@ describe('OC.Upload tests', function() { expect(result[1].submit.calledOnce).toEqual(false); expect(result[2].submit.calledOnce).toEqual(true); done(); - }, 0); + }, 10); }); var result = addFiles(uploader, [ {name: 'conflict.txt'}, @@ -251,8 +257,6 @@ describe('OC.Upload tests', function() { uploader.onReplace(upload); }); it('autorenames file when choosing replace in conflict mode', function(done) { - // needed for _.defer call - var clock = sinon.useFakeTimers(); var fileData = {name: 'conflict.txt'}; var uploadData = addFiles(uploader, [ fileData @@ -272,15 +276,15 @@ describe('OC.Upload tests', function() { expect(uploadData[0].submit.calledOnce).toEqual(true); getResponseStatusStub.returns(412); uploader.fileUploadParam.fail.call($dummyUploader[0], {}, uploadData[0]); - clock.tick(500); } if(counter===2) { - expect(upload.getFileName()).toEqual('conflict (3).txt'); - expect(uploadData[0].submit.calledTwice).toEqual(true); + _.defer(function() { + expect(upload.getFileName()).toEqual('conflict (3).txt'); + expect(uploadData[0].submit.calledTwice).toEqual(true); - clock.restore(); - done(); + done(); + }) } }); |