mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
* Update Crowdin configuration file * Update Crowdin configuration file * Add languages for pushing * Update Crowdin configuration file * Update source file en.json * New translations en.json (Finnish) * New translations en.json (Finnish) * New translations en.json (Romanian) * New translations en.json (Dutch) * New translations en.json (Croatian) * New translations en.json (Portuguese, Brazilian) * New translations en.json (Chinese Traditional) * New translations en.json (Chinese Simplified) * New translations en.json (Turkish) * New translations en.json (Swedish) * New translations en.json (Slovenian) * New translations en.json (Russian) * New translations en.json (Polish) * New translations en.json (Korean) * New translations en.json (French) * New translations en.json (Japanese) * New translations en.json (Italian) * New translations en.json (Hungarian) * New translations en.json (Hebrew) * New translations en.json (Greek) * New translations en.json (German) * New translations en.json (Danish) * New translations en.json (Czech) * New translations en.json (Bulgarian) * New translations en.json (Spanish) * New translations en.json (Norwegian Bokmal) * New translations en.json (Chinese Traditional) * New translations en.json (Chinese Simplified) * Remove folders * New translations en.json (Romanian) * New translations en.json (Korean) * New translations en.json (Croatian) * New translations en.json (Portuguese, Brazilian) * New translations en.json (Chinese Traditional) * New translations en.json (Turkish) * New translations en.json (Swedish) * New translations en.json (Slovenian) * New translations en.json (Russian) * New translations en.json (Polish) * New translations en.json (Dutch) * New translations en.json (Japanese) * New translations en.json (French) * New translations en.json (Italian) * New translations en.json (Hungarian) * New translations en.json (Hebrew) * New translations en.json (Finnish) * New translations en.json (Greek) * New translations en.json (German) * New translations en.json (Danish) * New translations en.json (Czech) * New translations en.json (Bulgarian) * New translations en.json (Norwegian Bokmal) * New translations en.json (Romanian) * New translations en.json (Korean) * New translations en.json (Croatian) * New translations en.json (Portuguese, Brazilian) * New translations en.json (Turkish) * New translations en.json (Swedish) * New translations en.json (Slovenian) * New translations en.json (Russian) * New translations en.json (Polish) * New translations en.json (Dutch) * New translations en.json (Japanese) * New translations en.json (French) * New translations en.json (Italian) * New translations en.json (Hungarian) * New translations en.json (Hebrew) * New translations en.json (Finnish) * New translations en.json (Greek) * New translations en.json (German) * New translations en.json (Danish) * New translations en.json (Czech) * New translations en.json (Bulgarian) * New translations en.json (Norwegian Bokmal) * Update Crowdin configuration file * New translations en.json (Spanish) * New translations en.json (Chinese Simplified) * New translations en.json (Chinese Traditional) * New translations en.json (Italian) * New translations en.json (Croatian) * New translations en.json (Portuguese, Brazilian) * New translations en.json (Turkish) * New translations en.json (Swedish) * New translations en.json (Slovenian) * New translations en.json (Russian) * New translations en.json (Polish) * New translations en.json (Dutch) * New translations en.json (Korean) * New translations en.json (Japanese) * New translations en.json (Hungarian) * New translations en.json (Hebrew) * New translations en.json (Finnish) * New translations en.json (Greek) * New translations en.json (German) * New translations en.json (Danish) * New translations en.json (Czech) * New translations en.json (Bulgarian) * New translations en.json (French) * New translations en.json (Romanian) * New translations en.json (Norwegian Bokmal) * Loading all languages now works * * Fix unit tests * Have server load localizations * Adding some more keys * New Crowdin updates (#6531) * New translations en.json (Finnish) * New translations en.json (Norwegian Bokmal) * New translations en.json (Finnish) * New translations en.json (Japanese) * New translations en.json (Portuguese, Brazilian) * New translations en.json (Chinese Traditional) * New translations en.json (Chinese Simplified) * New translations en.json (Turkish) * New translations en.json (Swedish) * New translations en.json (Slovenian) * New translations en.json (Russian) * New translations en.json (Polish) * New translations en.json (Dutch) * New translations en.json (Korean) * New translations en.json (Italian) * New translations en.json (Norwegian Bokmal) * New translations en.json (Hungarian) * New translations en.json (Hebrew) * New translations en.json (Greek) * New translations en.json (German) * New translations en.json (Danish) * New translations en.json (Czech) * New translations en.json (Bulgarian) * New translations en.json (Spanish) * New translations en.json (French) * New translations en.json (Romanian) * New translations en.json (Croatian) * Update source file en.json * New translations en.json (Norwegian Bokmal) * New translations en.json (Norwegian Bokmal) * Remove old translation status tool * Update CONTRIBUTING
58 lines
1.4 KiB
JavaScript
58 lines
1.4 KiB
JavaScript
'use strict';
|
|
|
|
require('should');
|
|
const fs = require('fs');
|
|
|
|
describe('Raw BG', function ( ) {
|
|
var ctx = {
|
|
settings: { units: 'mg/dl'}
|
|
, language: require('../lib/language')(fs)
|
|
, pluginBase: {}
|
|
};
|
|
ctx.language.set('en');
|
|
|
|
var rawbg = require('../lib/plugins/rawbg')(ctx);
|
|
|
|
var now = Date.now();
|
|
var data = {
|
|
sgvs: [{unfiltered: 113680, filtered: 111232, mgdl: 110, noise: 1, mills: now}]
|
|
, cals: [{scale: 1, intercept: 25717.82377004309, slope: 766.895601715918, mills: now}]
|
|
};
|
|
|
|
|
|
it('should calculate Raw BG', function (done) {
|
|
var sandbox = require('../lib/sandbox')();
|
|
var sbx = sandbox.clientInit(ctx, Date.now(), data);
|
|
|
|
sbx.offerProperty = function mockedOfferProperty (name, setter) {
|
|
name.should.equal('rawbg');
|
|
var result = setter();
|
|
result.mgdl.should.equal(113);
|
|
result.noiseLabel.should.equal('Clean');
|
|
done();
|
|
};
|
|
|
|
rawbg.setProperties(sbx);
|
|
|
|
});
|
|
|
|
it('should handle virtAsst requests', function (done) {
|
|
|
|
var sandbox = require('../lib/sandbox')();
|
|
var sbx = sandbox.clientInit(ctx, Date.now(), data);
|
|
|
|
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');
|
|
|
|
done();
|
|
}, [], sbx);
|
|
|
|
});
|
|
|
|
});
|