Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncalabrese committed Apr 14, 2016
1 parent 296e62d commit 1795310
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
12 changes: 10 additions & 2 deletions tests/openaps.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ var statuses = [{
eventualBG: 125,
timestamp: '2015-12-05T19:03:00.000Z',
duration: 30,
tick: '+1'
tick: '+1',
predBGs: {
IOB: [100, 100, 100, 100]
, aCOB: [100, 100, 100, 100]
, COB: [100, 100, 100, 100]
}
}
}
}
Expand Down Expand Up @@ -126,7 +131,7 @@ _.forEach(statuses, function updateMills (status) {

describe('openaps', function ( ) {

it('set the property and update the pill', function (done) {
it('set the property and update the pill and add forecast points', function (done) {
var ctx = {
settings: {
units: 'mg/dl'
Expand All @@ -141,6 +146,9 @@ describe('openaps', function ( ) {
var last = _.last(options.info);
last.label.should.equal('1h ago');
last.value.should.equal('awaitingpi ◉ Waiting');
}
, addForecastPoints: function mockAddForecastPoints(points) {
points.length.should.equal(12);
done();
}
}
Expand Down
5 changes: 2 additions & 3 deletions tests/update-throttle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ describe('Throttle', function ( ) {

it('only update once when there are multiple posts', function (done) {

//if the data-loaded event is triggered more than once the test will fail
self.ctx.bus.on('data-loaded', function dataWasLoaded ( ) {
self.ctx.dataloader.update = function mockedUpdate () {
done();
});
};

function post () {
request(self.app)
Expand Down

0 comments on commit 1795310

Please sign in to comment.