From b53bd6df11a8df1d867409b51adc14421ad97517 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 23 Sep 2015 22:23:58 +1200 Subject: Implement first web unit test --- web/tests.html | 12 ++++++++++++ web/tests/010_sanity.t.js | 15 ++++++++------- web/tests/index.html | 17 ----------------- web/tests/index.js | 10 +++++----- 4 files changed, 25 insertions(+), 29 deletions(-) create mode 100644 web/tests.html delete mode 100644 web/tests/index.html diff --git a/web/tests.html b/web/tests.html new file mode 100644 index 000000000..2e89e5e58 --- /dev/null +++ b/web/tests.html @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/web/tests/010_sanity.t.js b/web/tests/010_sanity.t.js index 9d5636493..a51decd9b 100644 --- a/web/tests/010_sanity.t.js +++ b/web/tests/010_sanity.t.js @@ -1,13 +1,14 @@ -// also supports: startTest(function(t) { StartTest(function(t) { t.diag("Sanity"); - t.ok(Ext, 'ExtJS is here'); - t.ok(Ext.Window, '.. indeed'); + t.ok(Ext, 'Ext is defined'); + t.ok(Ext.Window, 'Ext.Window is defined'); + t.ok(Traccar, 'Traccar is defined'); + t.ok(Traccar.Application, 'Traccar.Application is defined'); - t.ok(Your.Project, 'My project is here'); - t.ok(Your.Project.Util, '.. indeed'); + t.ok(strings, 'strings are defined'); + t.ok(styles, 'styles are defined'); - t.done(); // Optional, marks the correct exit point from the test -}) + t.done(); +}); diff --git a/web/tests/index.html b/web/tests/index.html deleted file mode 100644 index 334e13893..000000000 --- a/web/tests/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/web/tests/index.js b/web/tests/index.js index a3708d7f1..a75d6e4df 100644 --- a/web/tests/index.js +++ b/web/tests/index.js @@ -1,14 +1,14 @@ var Harness = Siesta.Harness.Browser.ExtJS; Harness.configure({ - title : 'Awesome Test Suite', - - preload : [ + title: 'Traccar Test Suite', + preload: [ '//cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/ext-all.js', - '../app.min.js' + 'locale.js', + 'app.js' ] }); Harness.start( - '010_sanity.t.js' + 'tests/010_sanity.t.js' ); -- cgit v1.2.3