1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-19 06:47:00 +02:00
TableFilter/test/test-rows-counter.js

27 lines
751 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.feature('rowsCounter'), null, 'RowsCounter instanciated');
2015-05-14 12:08:19 +02:00
});
2015-05-14 12:08:19 +02:00
test('RowsCounter component with paging', function() {
tf.Mod.paging = new TableFilter.Paging(tf);
var paging = tf.Mod.paging;
2015-06-13 11:03:33 +02:00
paging.reset();
equal(tf.feature('rowsCounter').rowsCounterSpan.innerHTML,
'1-7 / 7', 'Counter value with paging');
2015-05-14 12:08:19 +02:00
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.feature('rowsCounter').refresh();
2015-06-13 11:03:33 +02:00
equal(tf.feature('rowsCounter').rowsCounterSpan.innerHTML,
7, 'Counter value');
2014-11-16 01:29:07 +01:00
});