aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-09-23 22:23:58 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-09-23 22:23:58 +1200
commitb53bd6df11a8df1d867409b51adc14421ad97517 (patch)
treebad71eaa9dca6a62247f9c73572e474ae888df86
parent6e2387149e8758a6ea0c0788c0f70287ac8a36f1 (diff)
downloadtrackermap-server-b53bd6df11a8df1d867409b51adc14421ad97517.tar.gz
trackermap-server-b53bd6df11a8df1d867409b51adc14421ad97517.tar.bz2
trackermap-server-b53bd6df11a8df1d867409b51adc14421ad97517.zip
Implement first web unit test
-rw-r--r--web/tests.html (renamed from web/tests/index.html)7
-rw-r--r--web/tests/010_sanity.t.js15
-rw-r--r--web/tests/index.js10
3 files changed, 14 insertions, 18 deletions
diff --git a/web/tests/index.html b/web/tests.html
index 334e13893..2e89e5e58 100644
--- a/web/tests/index.html
+++ b/web/tests.html
@@ -1,17 +1,12 @@
<!DOCTYPE html>
<html>
<head>
-<!-- Siesta UI must use ExtJS 5.1.0 (you can specify any other ExtJS version in your "preload" config) -->
<link rel="stylesheet" type="text/css" href="//cdn.sencha.com/ext/gpl/5.1.0/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css" />
<link rel="stylesheet" type="text/css" href="//cdn.traccar.org/siesta/siesta-3.1.0-lite/resources/css/siesta-all.css">
-
-<!-- Siesta UI must use ExtJS 5.1.0 (you can specify any other ExtJS version in your "preload" config) -->
<script type="text/javascript" src="//cdn.sencha.com/ext/gpl/5.1.0/build/ext-all.js"></script>
<script type="text/javascript" src="//cdn.traccar.org/siesta/siesta-3.1.0-lite/siesta-all.js"></script>
-
-<script type="text/javascript" src="index.js"></script>
+<script type="text/javascript" src="tests/index.js"></script>
</head>
-
<body>
</body>
</html>
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.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'
);