Skip to content

Commit

Permalink
Merge pull request tidepool-org#507 from tidepool-org/gniezen/309-reg…
Browse files Browse the repository at this point in the history
…ression-fix

Fix regression: clearing the suspending event after use
  • Loading branch information
gniezen authored Aug 31, 2017
2 parents c5f821c + 35054ce commit 3211874
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/drivers/medtronic/medtronicSimulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ exports.make = function(config){
};

function setSuspendingEvent(event) {
if(currBasal.deliveryType !== 'suspend') {
if (currBasal.deliveryType !== 'suspend') {
suspendingEvent = event;
} else if (event === null) {
suspendingEvent = null;
}
};

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Tidepool Uploader",
"short_name": "Uploader",
"version": "0.311.0",
"version": "0.312.0",
"description": "The Tidepool Uploader helps you get your data from insulin pumps, CGMs and BG meters into Tidepool’s secure cloud platform.",
"minimum_chrome_version": "38",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tidepool-uploader",
"version": "0.311.0",
"version": "0.312.0",
"description": "Tidepool Project Universal Uploader",
"private": true,
"main": "main.js",
Expand Down
12 changes: 11 additions & 1 deletion test/node/medtronic/testMedtronicSimulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1681,6 +1681,14 @@ describe('medtronicSimulator.js', function() {
.with_rate(1.2);
basal2.deviceId = 'medtronic12345';

var basal3 = builder.makeScheduledBasal()
.with_time('2014-09-25T04:00:00.000Z')
.with_deviceTime('2014-09-25T04:00:00')
.with_timezoneOffset(0)
.with_conversionOffset(0)
.with_rate(2);
basal3.deviceId = 'medtronic12345';

var expectedSuspendResume = {
time: '2014-09-25T02:00:00.000Z',
deviceTime: '2014-09-25T02:00:00',
Expand All @@ -1699,6 +1707,7 @@ describe('medtronicSimulator.js', function() {
simulator.basal(basal1);
simulator.alarm(alarm);
simulator.basal(basal2);
simulator.basal(basal3);

var expectedBasal = builder.makeSuspendBasal()
.with_time('2014-09-25T02:00:00.000Z')
Expand All @@ -1719,7 +1728,8 @@ describe('medtronicSimulator.js', function() {
expect(simulator.getEvents()).deep.equals([
basal1.done(),
expectedAlarm,
expectedBasal
expectedBasal,
basal2.done() // checks that the suspending event has been cleared
]);
});
});
Expand Down

0 comments on commit 3211874

Please sign in to comment.