2015-03-06 09:49:30 +01:00
|
|
|
requirejs(['test-config', '../src/tablefilter'], function(config, TableFilter){
|
2015-02-01 09:26:48 +01:00
|
|
|
|
|
|
|
QUnit.start();
|
|
|
|
|
|
|
|
var CheckList = require('modules/checkList').CheckList,
|
|
|
|
types = require('types').Types,
|
|
|
|
dom = require('dom').Dom;
|
|
|
|
|
|
|
|
var tf = new TableFilter('demo', {
|
|
|
|
col_3: 'checklist',
|
|
|
|
fill_slc_on_demand: false
|
|
|
|
});
|
|
|
|
tf.init();
|
|
|
|
|
|
|
|
var checkList = tf.Cpt.checkList;
|
|
|
|
module('Sanity checks');
|
|
|
|
test('CheckList component', function() {
|
|
|
|
deepEqual(checkList instanceof CheckList, true, 'CheckList type');
|
|
|
|
notEqual(checkList, null, 'CheckList instanciated');
|
|
|
|
deepEqual(types.isArray(checkList.checkListDiv), true, 'Type of checkListDiv property');
|
|
|
|
});
|
|
|
|
|
|
|
|
module('UI elements');
|
|
|
|
test('CheckList UI elements', function() {
|
|
|
|
var flt = dom.id(tf.fltIds[3]);
|
|
|
|
notEqual(flt, null, 'CheckList UL element');
|
|
|
|
deepEqual(flt.firstChild.nodeName, 'LI', 'First CheckList option element name');
|
|
|
|
});
|
|
|
|
|
|
|
|
test('TableFilter removed', function() {
|
2015-02-21 04:39:09 +01:00
|
|
|
tf.remove();
|
2015-02-01 09:26:48 +01:00
|
|
|
deepEqual(dom.id(tf.fltIds[3]), null, 'CheckList UL element');
|
|
|
|
});
|
|
|
|
});
|