diff options
author | Clark Tomlinson <fallen013@gmail.com> | 2015-06-26 11:19:59 -0400 |
---|---|---|
committer | Clark Tomlinson <fallen013@gmail.com> | 2015-06-26 12:50:09 -0400 |
commit | ca1da0acb7f02bab9385fa3cbe3fe4453a13de82 (patch) | |
tree | 0c8178c99b63a8c43efc5b689ffed6f7f2e4a3b8 /apps/files/tests/js/filelistSpec.js | |
parent | ac9412639333b6876f7b4b9d0c9f1d2035890c58 (diff) | |
download | nextcloud-server-ca1da0acb7f02bab9385fa3cbe3fe4453a13de82.tar.gz nextcloud-server-ca1da0acb7f02bab9385fa3cbe3fe4453a13de82.zip |
add check if server returns a 500 and display error
resolves https://github.com/owncloud/core/issues/17170
Diffstat (limited to 'apps/files/tests/js/filelistSpec.js')
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 6bcef8b6f4f..b12ac2f2517 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -1290,6 +1290,17 @@ describe('OCA.Files.FileList tests', function() { fakeServer.respond(); expect(fileList.getCurrentDirectory()).toEqual('/'); }); + it('switches to root dir when current directory is unavailable', function() { + fakeServer.respondWith(/\/index\.php\/apps\/files\/ajax\/list.php\?dir=%2funexist/, [ + 500, { + "Content-Type": "application/json" + }, + '' + ]); + fileList.changeDirectory('/unexist'); + fakeServer.respond(); + expect(fileList.getCurrentDirectory()).toEqual('/'); + }); it('shows mask before loading file list then hides it at the end', function() { var showMaskStub = sinon.stub(fileList, 'showMask'); var hideMaskStub = sinon.stub(fileList, 'hideMask'); |