mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-06-09 09:22:28 +02:00
Expanded unit tests
This commit is contained in:
parent
2cbfc0b1ec
commit
5fc1c78d1b
|
@ -204,6 +204,36 @@ test('TableFilter re-initialised', function() {
|
||||||
deepEqual(id(tf.fltIds[3]).nodeName, 'SELECT', 'Filter exists');
|
deepEqual(id(tf.fltIds[3]).nodeName, 'SELECT', 'Filter exists');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
module('Properties');
|
||||||
|
test('Can set icon HTML', function() {
|
||||||
|
// setup
|
||||||
|
tf.destroy();
|
||||||
|
tf = new TableFilter('demo', {
|
||||||
|
base_path: '../dist/tablefilter/',
|
||||||
|
col_2: 'multiple',
|
||||||
|
col_3: 'select',
|
||||||
|
col_4: 'none',
|
||||||
|
popup_filters: {
|
||||||
|
image_html: '<span>hello world</span>'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var feature = tf.feature('popupFilter');
|
||||||
|
feature.filtersCache = [];
|
||||||
|
feature.fltElms = [];
|
||||||
|
|
||||||
|
// act
|
||||||
|
tf.init();
|
||||||
|
var headersRow = tf.dom().rows[tf.getHeadersRowIndex()];
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(
|
||||||
|
headersRow.cells[1].innerHTML
|
||||||
|
.indexOf('<span>hello world</span>') !== -1,
|
||||||
|
true,
|
||||||
|
'Custom HTML element present'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
module('Grid-layout');
|
module('Grid-layout');
|
||||||
test('Re-instantiated with grid-layout', function() {
|
test('Re-instantiated with grid-layout', function() {
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
|
|
Loading…
Reference in a new issue