mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
fix COB pill formatting; add more tests
This commit is contained in:
@@ -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);
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user