summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-01-24 13:19:44 +0100
committerVincent Petry <pvince81@owncloud.com>2014-01-24 13:19:44 +0100
commit0671c58e361f2ccf2cd23d73a9712c1a31e838ce (patch)
tree2eb7b84ef47e306a6b1fec2d1a2cc5278a9cf61e /apps/files/tests
parent41b6d4b702e8ed32f7ea51edffd0005639f77138 (diff)
downloadnextcloud-server-0671c58e361f2ccf2cd23d73a9712c1a31e838ce.tar.gz
nextcloud-server-0671c58e361f2ccf2cd23d73a9712c1a31e838ce.zip
Fixed filelist unit tests hidden params
Also added dummy table
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/filelistSpec.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 6b28a02989e..be848e0e0b0 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -21,11 +21,14 @@
describe('FileList tests', function() {
beforeEach(function() {
// init horrible parameters
- $('<input type="hidden" id="dir" value="/subdir"></input>').append('body');
- $('<input type="hidden" id="permissions" value="31"></input>').append('body');
+ var $body = $('body');
+ $body.append('<input type="hidden" id="dir" value="/subdir"></input>');
+ $body.append('<input type="hidden" id="permissions" value="31"></input>');
+ // dummy files table
+ $body.append('<table id="filestable"></table>');
});
afterEach(function() {
- $('#dir, #permissions').remove();
+ $('#dir, #permissions, #filestable').remove();
});
it('generates file element with correct attributes when calling addFile', function() {
var lastMod = new Date(10000);
@@ -36,7 +39,7 @@ describe('FileList tests', function() {
expect($tr.attr('data-type')).toEqual('file');
expect($tr.attr('data-file')).toEqual('testName.txt');
expect($tr.attr('data-size')).toEqual('1234');
- //expect($tr.attr('data-permissions')).toEqual('31');
+ expect($tr.attr('data-permissions')).toEqual('31');
//expect($tr.attr('data-mime')).toEqual('plain/text');
});
it('generates dir element with correct attributes when calling addDir', function() {
@@ -48,7 +51,7 @@ describe('FileList tests', function() {
expect($tr.attr('data-type')).toEqual('dir');
expect($tr.attr('data-file')).toEqual('testFolder');
expect($tr.attr('data-size')).toEqual('1234');
- //expect($tr.attr('data-permissions')).toEqual('31');
+ expect($tr.attr('data-permissions')).toEqual('31');
//expect($tr.attr('data-mime')).toEqual('httpd/unix-directory');
});
});