1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-27 01:40:18 +02:00
TableFilter/test/test-rows-counter.js

25 lines
711 B
JavaScript
Raw Normal View History

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-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
});