Fixed filelist unit tests hidden params
Also added dummy table
This commit is contained in:
parent
41b6d4b702
commit
0671c58e36
|
@ -21,11 +21,14 @@
|
||||||
describe('FileList tests', function() {
|
describe('FileList tests', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
// init horrible parameters
|
// init horrible parameters
|
||||||
$('<input type="hidden" id="dir" value="/subdir"></input>').append('body');
|
var $body = $('body');
|
||||||
$('<input type="hidden" id="permissions" value="31"></input>').append('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() {
|
afterEach(function() {
|
||||||
$('#dir, #permissions').remove();
|
$('#dir, #permissions, #filestable').remove();
|
||||||
});
|
});
|
||||||
it('generates file element with correct attributes when calling addFile', function() {
|
it('generates file element with correct attributes when calling addFile', function() {
|
||||||
var lastMod = new Date(10000);
|
var lastMod = new Date(10000);
|
||||||
|
@ -36,7 +39,7 @@ describe('FileList tests', function() {
|
||||||
expect($tr.attr('data-type')).toEqual('file');
|
expect($tr.attr('data-type')).toEqual('file');
|
||||||
expect($tr.attr('data-file')).toEqual('testName.txt');
|
expect($tr.attr('data-file')).toEqual('testName.txt');
|
||||||
expect($tr.attr('data-size')).toEqual('1234');
|
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');
|
//expect($tr.attr('data-mime')).toEqual('plain/text');
|
||||||
});
|
});
|
||||||
it('generates dir element with correct attributes when calling addDir', function() {
|
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-type')).toEqual('dir');
|
||||||
expect($tr.attr('data-file')).toEqual('testFolder');
|
expect($tr.attr('data-file')).toEqual('testFolder');
|
||||||
expect($tr.attr('data-size')).toEqual('1234');
|
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');
|
//expect($tr.attr('data-mime')).toEqual('httpd/unix-directory');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue