diff options
Diffstat (limited to 'apps/files_trashbin/tests/js/filelistSpec.js')
-rw-r--r-- | apps/files_trashbin/tests/js/filelistSpec.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/files_trashbin/tests/js/filelistSpec.js b/apps/files_trashbin/tests/js/filelistSpec.js index 9aa1f907fa9..05caaf27865 100644 --- a/apps/files_trashbin/tests/js/filelistSpec.js +++ b/apps/files_trashbin/tests/js/filelistSpec.js @@ -212,6 +212,26 @@ describe('OCA.Trashbin.FileList tests', function() { describe('breadcrumbs', function() { // TODO: test label + URL }); + describe('elementToFile', function() { + var $tr; + + beforeEach(function() { + fileList.setFiles(testFiles); + $tr = fileList.findFileEl('One.txt.d11111'); + }); + + it('converts data attributes to file info structure', function() { + var fileInfo = fileList.elementToFile($tr); + expect(fileInfo.id).toEqual(1); + expect(fileInfo.name).toEqual('One.txt.d11111'); + expect(fileInfo.displayName).toEqual('One.txt'); + expect(fileInfo.mtime).toEqual(11111000); + expect(fileInfo.etag).toEqual('abc'); + expect(fileInfo.permissions).toEqual(OC.PERMISSION_READ | OC.PERMISSION_DELETE); + expect(fileInfo.mimetype).toEqual('text/plain'); + expect(fileInfo.type).toEqual('file'); + }); + }); describe('Global Actions', function() { beforeEach(function() { fileList.setFiles(testFiles); |