fix COB pill formatting; add more tests

This commit is contained in:
Jason Calabrese
2015-06-27 12:11:28 -07:00
parent e5cf3cd0bd
commit e5a2c84b67
2 changed files with 25 additions and 1 deletions
+24
View File
@@ -63,5 +63,29 @@ describe('COB', function ( ) {
result5.cob.should.equal(0);
});
it('set a pill to the current COB', function (done) {
var app = {};
var clientSettings = {};
var data = {
treatments: [{carbs: "8", "created_at": new Date()}]
, profile: require('../lib/profilefunctions')([profileData])
};
var pluginBase = {
updatePillText: function mockedUpdatePillText (plugin, options) {
options.value.should.equal('8g');
done();
}
};
var sandbox = require('../lib/sandbox')();
var sbx = sandbox.clientInit(app, clientSettings, Date.now(), pluginBase, data);
cob.setProperties(sbx);
cob.updateVisualisation(sbx);
});
});