2015-02-01 09:26:48 +01:00
|
|
|
|
2015-05-10 13:12:31 +02:00
|
|
|
var id = function (id){ return document.getElementById(id); };
|
|
|
|
var tf = new TableFilter('demo', {
|
2015-05-15 12:37:27 +02:00
|
|
|
base_path: '../dist/tablefilter/',
|
2015-05-10 13:12:31 +02:00
|
|
|
col_3: 'checklist',
|
|
|
|
fill_slc_on_demand: false
|
|
|
|
});
|
|
|
|
tf.init();
|
2015-02-01 09:26:48 +01:00
|
|
|
|
2015-06-07 17:31:15 +02:00
|
|
|
var checkList = tf.feature('checkList');
|
2015-05-10 13:12:31 +02:00
|
|
|
module('Sanity checks');
|
|
|
|
test('CheckList component', function() {
|
|
|
|
deepEqual(typeof checkList, 'object', 'CheckList instanciated');
|
|
|
|
deepEqual(checkList.checkListDiv instanceof Array, true, 'Type of checkListDiv property');
|
|
|
|
});
|
2015-02-01 09:26:48 +01:00
|
|
|
|
2015-05-10 13:12:31 +02:00
|
|
|
module('UI elements');
|
|
|
|
test('CheckList UI elements', function() {
|
|
|
|
var flt = id(tf.fltIds[3]);
|
|
|
|
notEqual(flt, null, 'CheckList UL element');
|
|
|
|
deepEqual(flt.firstChild.nodeName, 'LI', 'First CheckList option element name');
|
|
|
|
});
|
2015-02-01 09:26:48 +01:00
|
|
|
|
2015-05-10 13:12:31 +02:00
|
|
|
test('TableFilter removed', function() {
|
2015-05-23 10:55:51 +02:00
|
|
|
tf.destroy();
|
2015-05-10 13:12:31 +02:00
|
|
|
deepEqual(id(tf.fltIds[3]), null, 'CheckList UL element');
|
2015-02-01 09:26:48 +01:00
|
|
|
});
|
2015-05-10 13:12:31 +02:00
|
|
|
|