1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-17 22:06:41 +02:00
TableFilter/test/test-checklist.js

28 lines
801 B
JavaScript
Raw Normal View History

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', {
col_3: 'checklist',
fill_slc_on_demand: false
});
tf.init();
2015-02-01 09:26:48 +01:00
2015-05-10 13:12:31 +02:00
var checkList = tf.Cpt.checkList;
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() {
tf.remove();
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