Fix unit tests

This commit is contained in:
Roeland Jago Douma 2015-07-09 18:42:46 +02:00
parent eea56dc309
commit eb7a796ad9
3 changed files with 13 additions and 4 deletions

View File

@ -710,6 +710,14 @@
path = this.getCurrentDirectory(); 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 // filename td
td = $('<td class="filename"></td>'); td = $('<td class="filename"></td>');

View File

@ -697,7 +697,7 @@ describe('OCA.Files.FileList tests', function() {
expect(fileList.findFileEl('One.txt').length).toEqual(1); expect(fileList.findFileEl('One.txt').length).toEqual(1);
expect(OC.TestUtil.getImageUrl(fileList.findFileEl('One.txt').find('.thumbnail'))) 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() { 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(notificationStub.getCall(0).args[0]).toEqual('Error while moving file');
expect(OC.TestUtil.getImageUrl(fileList.findFileEl('One.txt').find('.thumbnail'))) 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() { describe('List rendering', function() {
@ -1161,7 +1161,8 @@ describe('OCA.Files.FileList tests', function() {
var fileData = { var fileData = {
type: 'file', type: 'file',
name: 'test dir', 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 $tr = fileList.add(fileData);
var $imgDiv = $tr.find('td.filename .thumbnail'); var $imgDiv = $tr.find('td.filename .thumbnail');

View File

@ -90,7 +90,7 @@ describe('OCA.Sharing.Util tests', function() {
type: 'dir', type: 'dir',
name: 'One', name: 'One',
path: '/subdir', path: '/subdir',
mimetype: 'text/plain', mimetype: 'httpd/unix-directory',
size: 12, size: 12,
permissions: OC.PERMISSION_ALL, permissions: OC.PERMISSION_ALL,
etag: 'abc' etag: 'abc'