').should.be.greaterThan(-1); //success
result.indexOf('
CAL: Scale: 1.10 Intercept: 31102 Slope: 776.91').should.be.greaterThan(-1); //calibrations
diff --git a/tests/sandbox.test.js b/tests/sandbox.test.js
index d1be11b1eb1..966589a3129 100644
--- a/tests/sandbox.test.js
+++ b/tests/sandbox.test.js
@@ -18,6 +18,8 @@ describe('sandbox', function ( ) {
}
, pluginBase: {}
};
+
+ ctx.language = require('../lib/language')();
var data = {sgvs: [{mgdl: 100, mills: now}]};
@@ -35,6 +37,7 @@ describe('sandbox', function ( ) {
var ctx = {};
ctx.ddata = require('../lib/data/ddata')();
ctx.notifications = require('../lib/notifications')(env, ctx);
+ ctx.language = require('../lib/language')();
return sandbox.serverInit(env, ctx);
}
diff --git a/tests/security.test.js b/tests/security.test.js
index 80959cfeed3..6b612f1bc6e 100644
--- a/tests/security.test.js
+++ b/tests/security.test.js
@@ -10,7 +10,7 @@ describe('API_SECRET', function ( ) {
var scope = this;
function setup_app (env, fn) {
- require('../lib/bootevent')(env, language).boot(function booted (ctx) {
+ require('../lib/server/bootevent')(env, language).boot(function booted (ctx) {
ctx.app = api(env, ctx);
scope.app = ctx.app;
scope.entries = ctx.entries;
diff --git a/tests/sensorage.test.js b/tests/sensorage.test.js
index 87705866d33..2c7548598a4 100644
--- a/tests/sensorage.test.js
+++ b/tests/sensorage.test.js
@@ -44,6 +44,7 @@ describe('sage', function ( ) {
}
}
};
+ ctx.language = require('../lib/language')();
var sbx = sandbox.clientInit(ctx, Date.now(), data);
sage.setProperties(sbx);
@@ -71,6 +72,7 @@ describe('sage', function ( ) {
}
}
};
+ ctx.language = require('../lib/language')();
var sbx = sandbox.clientInit(ctx, Date.now(), data);
sage.setProperties(sbx);
@@ -98,6 +100,7 @@ describe('sage', function ( ) {
}
}
};
+ ctx.language = require('../lib/language')();
var sbx = sandbox.clientInit(ctx, Date.now(), data);
sage.setProperties(sbx);
@@ -127,6 +130,7 @@ describe('sage', function ( ) {
}
}
};
+ ctx.language = require('../lib/language')();
var sbx = sandbox.clientInit(ctx, Date.now(), data);
sage.setProperties(sbx);
diff --git a/tests/treatmentnotify.test.js b/tests/treatmentnotify.test.js
index d88722783d6..e9bc8abbd46 100644
--- a/tests/treatmentnotify.test.js
+++ b/tests/treatmentnotify.test.js
@@ -10,6 +10,8 @@ describe('treatmentnotify', function ( ) {
var ctx = {};
ctx.ddata = require('../lib/data/ddata')();
ctx.notifications = require('../lib/notifications')(env, ctx);
+ ctx.levels = levels;
+ ctx.language = require('../lib/language')().set('en');
var now = Date.now();
diff --git a/tests/upbat.test.js b/tests/upbat.test.js
index 0d70e581721..9b48c3b845e 100644
--- a/tests/upbat.test.js
+++ b/tests/upbat.test.js
@@ -9,7 +9,11 @@ describe('Uploader Battery', function ( ) {
var sandbox = require('../lib/sandbox')();
var ctx = {
settings: {}
+ , language: require('../lib/language')()
};
+ ctx.language.set('en');
+ ctx.levels = require('../lib/levels');
+
var sbx = sandbox.clientInit(ctx, Date.now(), data);
sbx.offerProperty = function mockedOfferProperty (name, setter) {
@@ -22,7 +26,7 @@ describe('Uploader Battery', function ( ) {
done();
};
- var upbat = require('../lib/plugins/upbat')();
+ var upbat = require('../lib/plugins/upbat')(ctx);
upbat.setProperties(sbx);
});
@@ -38,11 +42,13 @@ describe('Uploader Battery', function ( ) {
done();
}
}
+ , language: require('../lib/language')()
};
+ ctx.language.set('en');
var sandbox = require('../lib/sandbox')();
var sbx = sandbox.clientInit(ctx, Date.now(), data);
- var upbat = require('../lib/plugins/upbat')();
+ var upbat = require('../lib/plugins/upbat')(ctx);
upbat.setProperties(sbx);
upbat.updateVisualisation(sbx);
@@ -57,11 +63,13 @@ describe('Uploader Battery', function ( ) {
done();
}
}
+ , language: require('../lib/language')()
};
+ ctx.language.set('en');
var sandbox = require('../lib/sandbox')();
var sbx = sandbox.clientInit(ctx, Date.now(), {});
- var upbat = require('../lib/plugins/upbat')();
+ var upbat = require('../lib/plugins/upbat')(ctx);
upbat.setProperties(sbx);
upbat.updateVisualisation(sbx);
});
@@ -74,12 +82,13 @@ describe('Uploader Battery', function ( ) {
options.hide.should.equal(true);
done();
}
- }
+ }, language: require('../lib/language')()
};
+ ctx.language.set('en');
var sandbox = require('../lib/sandbox')();
var sbx = sandbox.clientInit(ctx, Date.now(), {devicestatus: [{uploader: {battery: -1}}]});
- var upbat = require('../lib/plugins/upbat')();
+ var upbat = require('../lib/plugins/upbat')(ctx);
upbat.setProperties(sbx);
upbat.updateVisualisation(sbx);
});
@@ -88,11 +97,13 @@ describe('Uploader Battery', function ( ) {
var ctx = {
settings: {}
+ , language: require('../lib/language')()
};
+ ctx.language.set('en');
var sandbox = require('../lib/sandbox')();
var sbx = sandbox.clientInit(ctx, Date.now(), data);
- var upbat = require('../lib/plugins/upbat')();
+ var upbat = require('../lib/plugins/upbat')(ctx);
upbat.setProperties(sbx);
upbat.alexa.intentHandlers.length.should.equal(1);
diff --git a/tests/verifyauth.test.js b/tests/verifyauth.test.js
index 871dd56f176..36624e03023 100644
--- a/tests/verifyauth.test.js
+++ b/tests/verifyauth.test.js
@@ -2,13 +2,14 @@
var request = require('supertest');
var language = require('../lib/language')();
+require('should');
describe('verifyauth', function ( ) {
var api = require('../lib/api/');
var scope = this;
function setup_app (env, fn) {
- require('../lib/bootevent')(env, language).boot(function booted (ctx) {
+ require('../lib/server/bootevent')(env, language).boot(function booted (ctx) {
ctx.app = api(env, ctx);
scope.app = ctx.app;
fn(ctx);
diff --git a/views/bgclock.html b/views/bgclock.html
index 183a5bb829f..903a395d56a 100644
--- a/views/bgclock.html
+++ b/views/bgclock.html
@@ -1,83 +1,142 @@
-
-
Nightscout BG NOW
-
-
-
+
-
-
-
-
-
-
-
+
+
+
+ init( );
+
diff --git a/views/clock.html b/views/clock.html
index 95f56a1e3f5..c0ac35d64be 100644
--- a/views/clock.html
+++ b/views/clock.html
@@ -1,78 +1,132 @@
-
-
Nightscout BG NOW
-
-
-
+
+
+
+
Nightscout
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+ init( );
+
diff --git a/views/index.html b/views/index.html
index fec1c6f0f7e..6a0237f0983 100644
--- a/views/index.html
+++ b/views/index.html
@@ -27,9 +27,10 @@
-
-
+
+
+