From d27826bac06ca54eeeba73420983a05a1a557cf6 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 17 Dec 2015 11:50:24 +0100 Subject: [PATCH] Correctly render uploadtext indicator only on folders --- apps/files/js/filelist.js | 2 +- apps/files/tests/js/filelistSpec.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 7e1329d1155..ec82117c2b3 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1068,7 +1068,7 @@ nameSpan.tooltip({placement: 'right'}); } // dirs can show the number of uploaded files - if (mime !== 'httpd/unix-directory') { + if (mime === 'httpd/unix-directory') { linkElem.append($('').attr({ 'class': 'uploadtext', 'currentUploads': 0 diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 3542a5cee8f..9dfcdfead7f 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -2402,6 +2402,21 @@ describe('OCA.Files.FileList tests', function() { expect(ev.result).not.toEqual(false); expect(uploadData.targetDir).toEqual('/a/b'); }); + it('renders upload indicator element for folders only', function() { + fileList.add({ + name: 'afolder', + type: 'dir', + mime: 'httpd/unix-directory' + }); + fileList.add({ + name: 'afile.txt', + type: 'file', + mime: 'text/plain' + }); + + expect(fileList.findFileEl('afolder').find('.uploadtext').length).toEqual(1); + expect(fileList.findFileEl('afile.txt').find('.uploadtext').length).toEqual(0); + }); }); }); describe('Handling errors', function () { -- 2.39.5