1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-03 07:03:33 +02:00

more unit tests

This commit is contained in:
koalyptus 2018-09-13 01:44:23 +10:00
parent 2f825a25b4
commit b14667a345

View file

@ -44,6 +44,37 @@ test('Match same term with increasing number of chars', function() {
'Search term matched');
});
// issue 628
test('unhighlight with term', function() {
// setup
tf.setFilterValue(0, 'Sydney');
tf.filter();
// act
highlightKeyword.unhighlight('Sydney', highlightKeyword.highlightCssClass);
// assert
deepEqual(tf.dom().querySelectorAll('.keyword').length, 0,
'term unhighlighted');
tf.clearFilters();
});
test('unhighlight with null term', function() {
// setup
tf.setFilterValue(0, 'Sydney');
tf.setFilterValue(1, 'Canbe');
tf.filter();
// act
highlightKeyword.unhighlight(null, highlightKeyword.highlightCssClass);
// assert
deepEqual(tf.dom().querySelectorAll('.keyword').length, 0,
'term unhighlighted');
tf.clearFilters();
});
module('Reset feature');
test('can destroy and init TableFilter', function() {
tf.destroy();