diff --git a/src/core.js b/src/core.js index 21a0fc5e..cb95d87a 100644 --- a/src/core.js +++ b/src/core.js @@ -941,7 +941,6 @@ TableFilter.prototype = { } if(this.loader){ - //this.SetLoader(); var Loader = require('modules/loader'); this.loaderCpt = new Loader(this); } @@ -1245,7 +1244,6 @@ TableFilter.prototype = { } if(this.loader){ - //this.ShowLoader('none'); this.loaderCpt.show('none'); } @@ -1331,18 +1329,16 @@ TableFilter.prototype = { o.StatusMsg(''); } if(o.loader){ - //o.ShowLoader('none'); o.loaderCpt.show('none'); } } if(this.loader || this.status || this.statusBar) { try{ - //this.ShowLoader(''); this.loaderCpt.show(''); this.StatusMsg(o['msg'+evt]); } catch(e){} - global.setTimeout(efx,this.execDelay); + global.setTimeout(efx, this.execDelay); } else { efx(); } @@ -1531,7 +1527,6 @@ TableFilter.prototype = { this.RemoveSort(); } if(this.loader){ - // this.RemoveLoader(); this.loaderCpt.remove(); } if(this.popUpFilters){ diff --git a/test/test-config.js b/test/test-config.js new file mode 100644 index 00000000..16fad928 --- /dev/null +++ b/test/test-config.js @@ -0,0 +1,9 @@ +(function () { + + // Configure RequireJS so it resolves relative module paths from the `src` + // folder. + require.config({ + baseUrl: '../src', + }); + +}()); \ No newline at end of file diff --git a/test/test-loader.html b/test/test-loader.html new file mode 100644 index 00000000..c482904d --- /dev/null +++ b/test/test-loader.html @@ -0,0 +1,82 @@ + + + + + TableFilter basic test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
+ + + +
+
+ + \ No newline at end of file diff --git a/test/test-loader.js b/test/test-loader.js new file mode 100644 index 00000000..c2ad6eec --- /dev/null +++ b/test/test-loader.js @@ -0,0 +1,20 @@ +requirejs(['test-config', '../src/core'], function(config, TableFilter){ + + QUnit.start(); + + var dom = require('dom'), + Loader = require('modules/loader'); + + var tf = new TableFilter('demo', { + loader: true + }); + tf.init(); + + module("Sanity checks"); + test("Loader component", function() { + deepEqual(tf.loaderCpt instanceof Loader, true, 'Loader constructor'); + notEqual(tf.loaderCpt, null, 'Loader instanciated'); + notEqual(dom.id(tf.prfxLoader+tf.id), null, 'Loader DOM container'); + }); + +}); \ No newline at end of file diff --git a/test/test.html b/test/test.html index 8950f2f0..ccded86d 100644 --- a/test/test.html +++ b/test/test.html @@ -5,6 +5,13 @@ TableFilter basic test + + + @@ -68,12 +75,9 @@
- +
- - - \ No newline at end of file diff --git a/test/test.js b/test/test.js index 02d5e4ac..4b5668af 100644 --- a/test/test.js +++ b/test/test.js @@ -1,9 +1,11 @@ -(function(TableFilter){ +requirejs(['test-config', '../src/core'], function(config, TableFilter){ + + QUnit.start(); var tf = new TableFilter('demo'); tf.init(); - module("Sanity check tests"); + module("Sanity checks"); test("TableFilter object", function() { equal(tf.id, 'demo', 'id check'); equal(tf.filtersRowIndex, 0, 'Filters row index'); @@ -16,4 +18,4 @@ equal(tf.GetFilterElement(0).nodeName, 'INPUT', 'Filter DOM element'); }); -})(TableFilter); \ No newline at end of file +});