mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
allow tests to pass
Switching the way units is fetched to this way makes it similar to the other code already in place that does something similar. This allows the tests to pass with the existing fixtures. Considering augmenting additional tests that explicitly tests whether the relevant branch of code is taken.
This commit is contained in:
@@ -392,7 +392,7 @@ function init (ctx) {
|
||||
function addSuggestion () {
|
||||
if (prop.lastSuggested) {
|
||||
var bg = prop.lastSuggested.bg;
|
||||
var units = sbx.data.profile.getUnits();
|
||||
var units = sbx.settings.units;
|
||||
|
||||
if (units === 'mmol') {
|
||||
bg = Math.round(bg / consts.MMOL_TO_MGDL * 10) / 10;
|
||||
@@ -479,11 +479,11 @@ function init (ctx) {
|
||||
if ('enacted' === prop.status.code) {
|
||||
var canceled = prop.lastEnacted.rate === 0 && prop.lastEnacted.duration === 0;
|
||||
var bg = prop.lastEnacted.bg;
|
||||
var units = sbx.data.profile.getUnits();
|
||||
var units = sbx.settings.units;
|
||||
|
||||
if (units === 'mmol') {
|
||||
bg = Math.round(bg / consts.MMOL_TO_MGDL * 10) / 10;
|
||||
}
|
||||
if (units === 'mmol') {
|
||||
bg = Math.round(bg / consts.MMOL_TO_MGDL * 10) / 10;
|
||||
}
|
||||
|
||||
var valueParts = [
|
||||
valueString('BG: ', bg)
|
||||
|
||||
Reference in New Issue
Block a user