2014-11-16 01:29:07 +01:00
|
|
|
|
2015-05-14 12:08:19 +02:00
|
|
|
var tf = new TableFilter('demo', {
|
|
|
|
base_path: '../dist/tablefilter/',
|
|
|
|
rows_counter: true
|
|
|
|
});
|
|
|
|
tf.init();
|
2014-11-16 01:29:07 +01:00
|
|
|
|
2015-05-14 12:08:19 +02:00
|
|
|
module('Sanity checks');
|
|
|
|
test('RowsCounter component', function() {
|
|
|
|
notEqual(tf.Cpt.rowsCounter, null, 'RowsCounter instanciated');
|
|
|
|
});
|
2015-01-26 10:31:25 +01:00
|
|
|
|
2015-05-14 12:08:19 +02:00
|
|
|
test('RowsCounter component with paging', function() {
|
|
|
|
tf.Cpt.paging = new TableFilter.Paging(tf);
|
|
|
|
var paging = tf.Cpt.paging;
|
|
|
|
paging.addPaging();
|
|
|
|
equal(tf.Cpt.rowsCounter.rowsCounterSpan.innerHTML, '1-7 / 7', 'Counter value with paging');
|
|
|
|
paging.destroy();
|
|
|
|
});
|
2014-11-16 01:29:07 +01:00
|
|
|
|
2015-05-14 12:08:19 +02:00
|
|
|
test('RowsCounter component without paging', function() {
|
|
|
|
tf.Cpt.rowsCounter.refresh();
|
|
|
|
equal(tf.Cpt.rowsCounter.rowsCounterSpan.innerHTML, 7, 'Counter value');
|
2014-11-16 01:29:07 +01:00
|
|
|
});
|