').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/timeago.test.js b/tests/timeago.test.js
index c0c88b8a1b1..66306a3d154 100644
--- a/tests/timeago.test.js
+++ b/tests/timeago.test.js
@@ -43,33 +43,6 @@ describe('timeago', function() {
done();
});
- it('should suspend alarms due to hibernation when 2 heartbeats are skipped on server', function() {
- ctx.ddata.sgvs = [{ mills: Date.now() - times.mins(16).msecs, mgdl: 100, type: 'sgv' }];
-
- var sbx = freshSBX()
- var status = timeago.checkStatus(sbx);
- // By default (no hibernation detected) a warning should be given
- // we force no hibernation by checking status twice
- status = timeago.checkStatus(sbx);
- should.equal(status, 'warn');
-
- // 10ms more than suspend-threshold to prevent flapping tests
- var timeoutMs = 2 * ctx.settings.heartbeat * 1000 + 100;
- return new Promise(function(resolve, reject) {
- setTimeout(function() {
- status = timeago.checkStatus(sbx);
- // Because hibernation should now be detected, no warning should be given
- should.equal(status, 'current');
-
- // We immediately ask status again, so hibernation should not be detected anymore,
- // and we should receive a warning again
- status = timeago.checkStatus(sbx);
- should.equal(status, 'warn');
-
- resolve()
- }, timeoutMs)
- })
- });
it('should trigger a warning when data older than 15m', function(done) {
ctx.notifications.initRequests();
@@ -80,9 +53,6 @@ describe('timeago', function() {
var currentTime = new Date().getTime();
- // eslint-disable-next-line no-empty
- while (currentTime + 500 >= new Date().getTime()) {}
-
var highest = ctx.notifications.findHighestAlarm('Time Ago');
highest.level.should.equal(levels.WARN);
highest.message.should.equal('Last received: 16 mins ago\nBG Now: 100 mg/dl');
diff --git a/tests/units.test.js b/tests/units.test.js
index b6e8a9faa8f..2fbef0c4d3e 100644
--- a/tests/units.test.js
+++ b/tests/units.test.js
@@ -13,4 +13,20 @@ describe('units', function ( ) {
units.mgdlToMMOL(180).should.equal('10.0');
});
+ it('should convert 5.5 to 99', function () {
+ units.mmolToMgdl(5.5).should.equal(99);
+ });
+
+ it('should convert 10.0 to 180', function () {
+ units.mmolToMgdl(10.0).should.equal(180);
+ });
+
+ it('should convert 5.5 mmol and then convert back to 5.5 mmol', function () {
+ units.mgdlToMMOL(units.mmolToMgdl(5.5)).should.equal('5.5');
+ });
+
+ it('should convert 99 mgdl and then convert back to 99 mgdl', function () {
+ units.mmolToMgdl(units.mgdlToMMOL(99)).should.equal(99);
+ });
+
});
diff --git a/views/adminindex.html b/views/adminindex.html
index 6108d1b3978..c9bb631cfeb 100644
--- a/views/adminindex.html
+++ b/views/adminindex.html
@@ -32,23 +32,12 @@
<% include preloadCSS %>
-
-
-
X
-
-
-
Nightscout
-
-
-
-
Admin Tools
-
+
+ <%- include('partials/toolbar') %>
-
-
-
Authentication status:
-
+
+ <%- include('partials/authentication-status') %>
diff --git a/views/foodindex.html b/views/foodindex.html
index d42eb16a50b..0cbb6a3ebf6 100644
--- a/views/foodindex.html
+++ b/views/foodindex.html
@@ -32,22 +32,9 @@
<% include preloadCSS %>
-
+
+ <%- include('partials/toolbar') %>
-
X
-
-
-
-
-
-
+
+ <%- include('partials/authentication-status') %>
+
diff --git a/views/index.html b/views/index.html
index b80e11ddd42..153e187b7f7 100644
--- a/views/index.html
+++ b/views/index.html
@@ -117,17 +117,8 @@