mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
Re-added handler count tests so devs are prompted to write tests for new handlers
This commit is contained in:
@@ -154,6 +154,8 @@ describe('ar2', function ( ) {
|
||||
ctx.ddata.sgvs = [{mgdl: 100, mills: before}, {mgdl: 105, mills: now}];
|
||||
var sbx = prepareSandbox();
|
||||
|
||||
ar2.virtAsst.intentHandlers.length.should.equal(1);
|
||||
|
||||
ar2.virtAsst.intentHandlers[0].intentHandler(function next(title, response) {
|
||||
title.should.equal('AR2 Forecast');
|
||||
response.should.equal('You are expected to be between 109 and 120 over the in 30 minutes');
|
||||
|
||||
@@ -92,6 +92,9 @@ describe('basalprofile', function ( ) {
|
||||
var sbx = sandbox.clientInit(ctx, time, data);
|
||||
sbx.data.profile = profile;
|
||||
|
||||
basal.virtAsst.intentHandlers.length.should.equal(1);
|
||||
basal.virtAsst.rollupHandlers.length.should.equal(1);
|
||||
|
||||
basal.virtAsst.intentHandlers[0].intentHandler(function next(title, response) {
|
||||
title.should.equal('Current Basal');
|
||||
response.should.equal('Your current basal is 0.175 units per hour');
|
||||
|
||||
@@ -110,6 +110,8 @@ describe('COB', function ( ) {
|
||||
var sbx = sandbox.clientInit(ctx, Date.now(), data);
|
||||
cob.setProperties(sbx);
|
||||
|
||||
cob.virtAsst.intentHandlers.length.should.equal(1);
|
||||
|
||||
cob.virtAsst.intentHandlers[0].intentHandler(function next(title, response) {
|
||||
title.should.equal('Current COB');
|
||||
response.should.equal('You have 8 carbohydrates on board');
|
||||
|
||||
@@ -20,6 +20,9 @@ describe('IOB', function() {
|
||||
}
|
||||
};
|
||||
|
||||
iob.virtAsst.intentHandlers.length.should.equal(1);
|
||||
iob.virtAsst.rollupHandlers.length.should.equal(1);
|
||||
|
||||
iob.virtAsst.intentHandlers[0].intentHandler(function next(title, response) {
|
||||
title.should.equal('Current IOB');
|
||||
response.should.equal('You have 1.50 units of insulin on board');
|
||||
|
||||
@@ -255,6 +255,8 @@ describe('loop', function ( ) {
|
||||
var sbx = sandbox.clientInit(ctx, now.valueOf(), {devicestatus: statuses});
|
||||
loop.setProperties(sbx);
|
||||
|
||||
loop.virtAsst.intentHandlers.length.should.equal(2);
|
||||
|
||||
loop.virtAsst.intentHandlers[0].intentHandler(function next(title, response) {
|
||||
title.should.equal('Loop Forecast');
|
||||
response.should.equal('According to the loop forecast you are expected to be between 147 and 149 over the next in 25 minutes');
|
||||
|
||||
@@ -382,6 +382,8 @@ describe('openaps', function ( ) {
|
||||
var sbx = sandbox.clientInit(ctx, now.valueOf(), {devicestatus: statuses});
|
||||
openaps.setProperties(sbx);
|
||||
|
||||
openaps.virtAsst.intentHandlers.length.should.equal(2);
|
||||
|
||||
openaps.virtAsst.intentHandlers[0].intentHandler(function next(title, response) {
|
||||
title.should.equal('Loop Forecast');
|
||||
response.should.equal('The OpenAPS Eventual BG is 125');
|
||||
|
||||
@@ -266,6 +266,8 @@ describe('pump', function ( ) {
|
||||
var sbx = sandbox.clientInit(ctx, now.valueOf(), {devicestatus: statuses});
|
||||
pump.setProperties(sbx);
|
||||
|
||||
pump.virtAsst.intentHandlers.length.should.equal(4);
|
||||
|
||||
pump.virtAsst.intentHandlers[0].intentHandler(function next(title, response) {
|
||||
title.should.equal('Remaining insulin');
|
||||
response.should.equal('You have 86.4 units remaining');
|
||||
|
||||
@@ -42,6 +42,8 @@ describe('Raw BG', function ( ) {
|
||||
|
||||
rawbg.setProperties(sbx);
|
||||
|
||||
rawbg.virtAsst.intentHandlers.length.should.equal(1);
|
||||
|
||||
rawbg.virtAsst.intentHandlers[0].intentHandler(function next(title, response) {
|
||||
title.should.equal('Current Raw BG');
|
||||
response.should.equal('Your raw bg is 113');
|
||||
|
||||
@@ -106,6 +106,8 @@ describe('Uploader Battery', function ( ) {
|
||||
var upbat = require('../lib/plugins/upbat')(ctx);
|
||||
upbat.setProperties(sbx);
|
||||
|
||||
upbat.virtAsst.intentHandlers.length.should.equal(2);
|
||||
|
||||
upbat.virtAsst.intentHandlers[0].intentHandler(function next(title, response) {
|
||||
title.should.equal('Uploader battery');
|
||||
response.should.equal('Your uploader battery is at 20%');
|
||||
|
||||
Reference in New Issue
Block a user