diff options
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 7947dd91f2d..d140299d228 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -2614,6 +2614,14 @@ describe('OCA.Files.FileList tests', function() { }); }); describe('Sorting files', function() { + + /** + * Set any user id before tests. + */ + beforeEach(function() { + OC.currentUser = 1; + }); + it('Toggles the sort indicator when clicking on a column header', function() { var ASC_CLASS = fileList.SORT_INDICATOR_ASC_CLASS; var DESC_CLASS = fileList.SORT_INDICATOR_DESC_CLASS; @@ -2739,6 +2747,14 @@ describe('OCA.Files.FileList tests', function() { sortStub.restore(); }); + + it('doesn\'t send a sort update request if there is no user logged in', function() { + OC.currentUser = false; + fileList.$el.find('.column-size .columntitle').click(); + // check if there was no request + expect(fakeServer.requests.length).toEqual(0); + }); + describe('with favorites', function() { it('shows favorite files on top', function() { testFiles.push(new FileInfo({ |