diff options
author | Joas Schilling <coding@schilljs.com> | 2016-11-16 19:10:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-16 19:10:35 +0100 |
commit | 8f38adaab19053622d54f8cd55f4a8ba97b59cef (patch) | |
tree | 93025cc79f27bcdd1c1fc4ccc7011d6049ccdfac /apps/files/tests | |
parent | cc8750ca30ba5d13ca59cc8c3ce87122a451829a (diff) | |
parent | 1141fcc9ac1dfd80deeef66e82ee2c8968bdce4d (diff) | |
download | nextcloud-server-8f38adaab19053622d54f8cd55f4a8ba97b59cef.tar.gz nextcloud-server-8f38adaab19053622d54f8cd55f4a8ba97b59cef.zip |
Merge pull request #2123 from nextcloud/downstream-26522
Skip hidden files when counting visible files in list
Diffstat (limited to 'apps/files/tests')
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 15dab3b9882..d8fc3907d78 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -1120,6 +1120,34 @@ describe('OCA.Files.FileList tests', function() { expect(fileList.files.length).toEqual(65); expect($('#fileList tr').length).toEqual(20); }); + it('renders the full first page despite hidden rows', function() { + filesConfig.set('showhidden', false); + var files = _.map(generateFiles(0, 23), function(data) { + return _.extend(data, { + name: '.' + data.name + }); + }); + // only hidden files + one visible + files.push(testFiles[0]); + fileList.setFiles(files); + expect(fileList.files.length).toEqual(25); + // render 24 hidden elements + the visible one + expect($('#fileList tr').length).toEqual(25); + }); + it('renders the full first page despite hidden rows', function() { + filesConfig.set('showhidden', true); + var files = _.map(generateFiles(0, 23), function(data) { + return _.extend(data, { + name: '.' + data.name + }); + }); + // only hidden files + one visible + files.push(testFiles[0]); + fileList.setFiles(files); + expect(fileList.files.length).toEqual(25); + // render 20 first hidden elements as visible + expect($('#fileList tr').length).toEqual(20); + }); it('renders the second page when scrolling down (trigger nextPage)', function() { // TODO: can't simulate scrolling here, so calling nextPage directly fileList._nextPage(true); |