* Use the delta plugin data to show the delta in the clock views
* Update Node checks
* Fix disabling the BG alarms for simple alarms
* Load battery and other rare events up to two months back
* Possibly fixes compatibility with ios9 - needs testing
* Unified black and color clock layouts
* Update clock data every 20 seconds
* Update clock time every second
* Fix how CSP policy is set for Helmet, fixes #6260
* Authorization fix for misformatted URLs
* Added unit test for batch upload of CGM entries
* Improved / removed some logging
* Test if user is in read only mode when Nightscout starts and give an error if so
This commit is contained in:
Sulka Haro
2020-11-10 18:02:28 +02:00
committed by GitHub
parent 775324174e
commit b762ade017
13 changed files with 326 additions and 198 deletions
+62
View File
@@ -307,4 +307,66 @@ describe('Entries REST api', function ( ) {
});
});
it('post multipole entries, query, delete, verify gone', function (done) {
// insert a glucose entry - needs to be unique from example data
console.log('Inserting glucose entry')
request(self.app)
.post('/entries/')
.set('api-secret', self.env.api_secret || '')
.send([{
"type": "sgv", "sgv": "199", "dateString": "2014-07-20T00:44:15.000-07:00"
, "date": 1405791855000, "device": "dexcom", "direction": "NOT COMPUTABLE"
}, {
"type": "sgv", "sgv": "200", "dateString": "2014-07-20T00:44:15.001-07:00"
, "date": 1405791855001, "device": "dexcom", "direction": "NOT COMPUTABLE"
}])
.expect(200)
.end(function (err) {
if (err) {
done(err);
} else {
// make sure treatment was inserted successfully
console.log('Ensuring glucose entry was inserted successfully');
request(self.app)
.get('/entries.json?find[dateString][$gte]=2014-07-20&count=100')
.set('api-secret', self.env.api_secret || '')
.expect(200)
.expect(function (response) {
var entry = response.body[0];
response.body.length.should.equal(2);
entry.sgv.should.equal('200');
entry.utcOffset.should.equal(-420);
})
.end(function (err) {
if (err) {
done(err);
} else {
// delete the glucose entry
console.log('Deleting test glucose entry');
request(self.app)
.delete('/entries.json?find[dateString][$gte]=2014-07-20&count=100')
.set('api-secret', self.env.api_secret || '')
.expect(200)
.end(function (err) {
if (err) {
done(err);
} else {
// make sure it was deleted
console.log('Testing if glucose entries were deleted');
request(self.app)
.get('/entries.json?find[dateString][$gte]=2014-07-20&count=100')
.set('api-secret', self.env.api_secret || '')
.expect(200)
.expect(function (response) {
response.body.length.should.equal(0);
})
.end(done);
}
});
}
});
}
});
});
});