1 | (function(win, TableFilter){
|
2 | var tf = new TableFilter('demo', {
|
3 | base_path: '../dist/tablefilter/',
|
4 | case_sensitive: true
|
5 | });
|
6 | tf.init();
|
7 |
|
8 | module('Sanity checks');
|
9 | test('Enable case sensitive query match', function() {
|
10 | deepEqual(tf instanceof TableFilter, true, 'TableFilter type');
|
11 | deepEqual(tf.caseSensitive, true, 'Case sensitive query match enabled');
|
12 | });
|
13 |
|
14 | module('Behaviour');
|
15 | test('After filtering with `sydney`', function() {
|
16 | tf.setFilterValue(0, 'sydney');
|
17 | tf.filter();
|
18 | deepEqual(tf.getValidRows().length, 0, 'No matches');
|
19 | });
|
20 |
|
21 | test('After filtering with `Sydney`', function() {
|
22 | tf.setFilterValue(0, 'Sydney');
|
23 | tf.filter();
|
24 | deepEqual(tf.getValidRows().length>0, true, 'Matches');
|
25 | });
|
26 |
|
27 | test('After filtering with `ade`', function() {
|
28 | tf.setFilterValue(0, 'ade');
|
29 | tf.filter();
|
30 | deepEqual(tf.getValidRows().length, 0, 'No matches');
|
31 | });
|
32 |
|
33 | test('After filtering with `Ade`', function() {
|
34 | tf.setFilterValue(0, 'Ade');
|
35 | tf.filter();
|
36 | deepEqual(tf.getValidRows().length>0, true, 'Matches');
|
37 | });
|
38 |
|
39 | })(window, TableFilter);
|