diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-07-09 18:42:46 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-07-09 18:42:46 +0200 |
commit | eb7a796ad98ec833e49c2544f03da52d11c302b1 (patch) | |
tree | 5b26b73bfbdb5e3692f15e10c590e93b8fc1bf8d | |
parent | eea56dc309ea8fc5855990a7608654c3b07cf8ae (diff) | |
download | nextcloud-server-eb7a796ad98ec833e49c2544f03da52d11c302b1.tar.gz nextcloud-server-eb7a796ad98ec833e49c2544f03da52d11c302b1.zip |
Fix unit tests
-rw-r--r-- | apps/files/js/filelist.js | 8 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 7 | ||||
-rw-r--r-- | apps/files_sharing/tests/js/shareSpec.js | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 79ee355125d..a3fd605ff7e 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -710,6 +710,14 @@ path = this.getCurrentDirectory(); } + if (type === 'dir') { + // use default folder icon + icon = icon || OC.imagePath('core', 'filetypes/folder'); + } + else { + icon = icon || OC.imagePath('core', 'filetypes/file'); + } + // filename td td = $('<td class="filename"></td>'); diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index b12ac2f2517..316df0281e9 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -697,7 +697,7 @@ describe('OCA.Files.FileList tests', function() { expect(fileList.findFileEl('One.txt').length).toEqual(1); expect(OC.TestUtil.getImageUrl(fileList.findFileEl('One.txt').find('.thumbnail'))) - .toEqual(OC.imagePath('core', 'filetypes/file.svg')); + .toEqual(OC.imagePath('core', 'filetypes/text.svg')); }); }); describe('Moving files', function() { @@ -816,7 +816,7 @@ describe('OCA.Files.FileList tests', function() { expect(notificationStub.getCall(0).args[0]).toEqual('Error while moving file'); expect(OC.TestUtil.getImageUrl(fileList.findFileEl('One.txt').find('.thumbnail'))) - .toEqual(OC.imagePath('core', 'filetypes/file.svg')); + .toEqual(OC.imagePath('core', 'filetypes/text.svg')); }); }); describe('List rendering', function() { @@ -1161,7 +1161,8 @@ describe('OCA.Files.FileList tests', function() { var fileData = { type: 'file', name: 'test dir', - icon: OC.webroot + '/core/img/filetypes/application-pdf.svg' + icon: OC.webroot + '/core/img/filetypes/application-pdf.svg', + mimetype: 'application/pdf' }; var $tr = fileList.add(fileData); var $imgDiv = $tr.find('td.filename .thumbnail'); diff --git a/apps/files_sharing/tests/js/shareSpec.js b/apps/files_sharing/tests/js/shareSpec.js index 1bbf4ffca09..aa409285ca4 100644 --- a/apps/files_sharing/tests/js/shareSpec.js +++ b/apps/files_sharing/tests/js/shareSpec.js @@ -90,7 +90,7 @@ describe('OCA.Sharing.Util tests', function() { type: 'dir', name: 'One', path: '/subdir', - mimetype: 'text/plain', + mimetype: 'httpd/unix-directory', size: 12, permissions: OC.PERMISSION_ALL, etag: 'abc' |