Re-added handler count tests so devs are prompted to write tests for new handlers

This commit is contained in:
inventor96
2019-09-10 00:14:21 -06:00
parent 3563158aae
commit 0a48c1d81a
9 changed files with 20 additions and 0 deletions
+2
View File
@@ -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');
+3
View File
@@ -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');
+2
View File
@@ -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');
+3
View File
@@ -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');
+2
View File
@@ -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');
+2
View File
@@ -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');
+2
View File
@@ -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');
+2
View File
@@ -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');
+2
View File
@@ -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%');