1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-18 14:26:40 +02:00
TableFilter/test/test-col-widths.js

34 lines
1.1 KiB
JavaScript
Raw Normal View History

2015-05-28 15:44:23 +02:00
(function(win, TableFilter){
var tf = new TableFilter('demo', {
base_path: '../dist/tablefilter/',
col_widths: ['150px', '100px', '175px', '120px', null]
});
tf.init();
module('Sanity checks');
test('Column widths', function() {
2015-06-06 14:22:13 +02:00
var cols = tf.tbl.getElementsByTagName('col');
2015-05-28 15:44:23 +02:00
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
2015-06-06 14:22:13 +02:00
deepEqual(cols[1].style.width, '100px', 'Expected column width');
deepEqual(cols[4].style.width, '', 'Expected column width');
2015-05-28 15:44:23 +02:00
});
test('Grid layout column widths', function() {
tf.destroy();
tf = null;
tf = new TableFilter('demo', {
base_path: '../dist/tablefilter/',
col_widths: ['150px', '100px', '175px', '120px', '200px'],
grid_layout: true,
sort: false
});
tf.init();
var cols = tf.feature('gridLayout').headTbl.getElementsByTagName('col');
2015-06-06 14:22:13 +02:00
deepEqual(cols[0].style.width, '150px', 'Expected column width');
deepEqual(cols[4].style.width, '200px', 'Expected column width');
2015-05-28 15:44:23 +02:00
});
2015-06-06 14:22:13 +02:00
})(window, TableFilter);