]> source.dussan.org Git - nextcloud-server.git/commitdiff
Correctly render uploadtext indicator only on folders
authorVincent Petry <pvince81@owncloud.com>
Thu, 17 Dec 2015 10:50:24 +0000 (11:50 +0100)
committerVincent Petry <pvince81@owncloud.com>
Fri, 18 Dec 2015 17:09:46 +0000 (18:09 +0100)
apps/files/js/filelist.js
apps/files/tests/js/filelistSpec.js

index 7e1329d1155336951c5a1f01b6c08f0ccf057ad1..ec82117c2b36153f2d8431c01f2fc026b124f503 100644 (file)
                                nameSpan.tooltip({placement: 'right'});
                        }
                        // dirs can show the number of uploaded files
-                       if (mime !== 'httpd/unix-directory') {
+                       if (mime === 'httpd/unix-directory') {
                                linkElem.append($('<span></span>').attr({
                                        'class': 'uploadtext',
                                        'currentUploads': 0
index 3542a5cee8f999cee76fa6c3c938d3e655e99a41..9dfcdfead7fe9eab3fc930b5c475a8154adde275 100644 (file)
@@ -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 () {