mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-06-08 08:52:32 +02:00
more unit tests
This commit is contained in:
parent
2f825a25b4
commit
b14667a345
|
@ -44,6 +44,37 @@ test('Match same term with increasing number of chars', function() {
|
||||||
'Search term matched');
|
'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');
|
module('Reset feature');
|
||||||
test('can destroy and init TableFilter', function() {
|
test('can destroy and init TableFilter', function() {
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
|
|
Loading…
Reference in a new issue