Correctly render uploadtext indicator only on folders

This commit is contained in:
Vincent Petry 2015-12-17 11:50:24 +01:00
parent 95a255b0d4
commit d27826bac0
2 changed files with 16 additions and 1 deletions

View File

@ -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($('<span></span>').attr({
'class': 'uploadtext',
'currentUploads': 0

View 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 () {