Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge 10.17.2016 #2

Merged
merged 1,275 commits into from
Oct 18, 2016
Merged
Changes from 1 commit
Commits
Show all changes
1275 commits
Select commit Hold shift + click to select a range
f23949f
fix issue comparing sensor start/change events
jasoncalabrese May 29, 2016
054d93e
Merge pull request #1777 from nightscout/wip/sage-events
jasoncalabrese May 29, 2016
09ae9f1
fix IAGE notes
jasoncalabrese May 29, 2016
cc57b17
fix readme anchor
jasoncalabrese May 29, 2016
9abab23
fix issue with ALARM_*_MINS not working for a single value
jasoncalabrese May 29, 2016
71a6797
Merge pull request #1778 from nightscout/wip/more-cleanup
jasoncalabrese May 29, 2016
2ec547c
Merge branch 'dev' into wip/report/range-compare
jasoncalabrese May 29, 2016
f29a7b2
RO - translation update 29.05.2016
bogdangorescu May 29, 2016
ce4a12b
remove debug
jasoncalabrese May 29, 2016
fa94f27
Merge pull request #1779 from bogdangorescu/patch-13
jasoncalabrese May 29, 2016
e5907ca
Update azuredeploy.json
MilosKozak May 29, 2016
b73d744
Merge pull request #1781 from nightscout/azuredefaults
jasoncalabrese May 29, 2016
8148c5f
fix/cleanup some things with SAGE/CAGE/IAGE and add a SAGE test
jasoncalabrese May 29, 2016
f963bb4
fix race condition, noticed by @jasoncalabrese
bewest May 29, 2016
8c66d63
Merge branch 'wip/report/range-compare' of github.com:nightscout/cgm-…
bewest May 29, 2016
299a958
renamed Sendor Change to Sensor Insert
jasoncalabrese May 29, 2016
56a68a6
Merge pull request #1782 from nightscout/wip/sages
jasoncalabrese May 29, 2016
03a5e90
remove debug
jasoncalabrese May 29, 2016
4f4e16b
Merge pull request #1359 from nightscout/wip/report/range-compare
jasoncalabrese May 30, 2016
e6bd7e4
bump version to 0.9 beta3
jasoncalabrese May 30, 2016
7e45277
some minor fixes for the openaps status info
jasoncalabrese Jun 4, 2016
a4634e8
another notEnacted fix
jasoncalabrese Jun 4, 2016
a8b8b03
Merge pull request #1791 from nightscout/wip/openaps-status-fixes
jasoncalabrese Jun 5, 2016
419a652
Update language.js
martijnmcb Jun 7, 2016
1fc040c
Fixed iob errors from AMA when it is null
dpiessens Jun 8, 2016
080c953
Added missing semicolon
dpiessens Jun 8, 2016
5d0e1f8
delete broken test
jasoncalabrese Jun 8, 2016
e3d1b58
fix more tests
jasoncalabrese Jun 8, 2016
dad0e83
try an new ddata to prevent tests from stepping on each other
jasoncalabrese Jun 8, 2016
935199e
Merge pull request #1798 from nightscout/wip/less-tests
jasoncalabrese Jun 8, 2016
8a54aa1
Korean translation add
jungsomyeong Jun 8, 2016
40fea41
Merge pull request #1795 from dpiessens/wip/openaps-iob-patch
jasoncalabrese Jun 8, 2016
00d728e
Merge pull request #1799 from jungsomyeong/patch-1
MilosKozak Jun 8, 2016
d080a36
merge fix
MilosKozak Jun 8, 2016
c2518c4
Merge pull request #1800 from MilosKozak/dev
MilosKozak Jun 8, 2016
7b985ab
fix treatment confirmation text and pushover message when canceling a…
jasoncalabrese Jun 9, 2016
035eb4f
acking a stale data alarm on 1 web client or from pushover should cle…
jasoncalabrese Jun 9, 2016
056c33a
back to minFractions <= 20 now that the other *age plugin alert issue…
jasoncalabrese Jun 9, 2016
f6cbb1d
Merge branch 'dev' into wip/properties-api
jasoncalabrese Jun 9, 2016
560d499
Merge branch 'wip/properties-api' into wip/june9th
jasoncalabrese Jun 9, 2016
564ab83
set/use a property for cage/sage/iage for new properties API; clean up
jasoncalabrese Jun 9, 2016
a0544a3
fix cage/sage tests
jasoncalabrese Jun 9, 2016
9f1e3a3
;'s
jasoncalabrese Jun 9, 2016
ae2d429
allow the api secret to be included in the post body
jasoncalabrese Jun 9, 2016
676f386
Merge pull request #1806 from nightscout/wip/june9th
jasoncalabrese Jun 10, 2016
bc0248c
Korean translation update
jungsomyeong Jun 12, 2016
a798be7
Fixed error
jungsomyeong Jun 12, 2016
9efaf3e
Merge pull request #1817 from jungsomyeong/patch-8
MilosKozak Jun 12, 2016
21a4ce5
add NSCLIENT_ID to deduping rules
MilosKozak Jun 20, 2016
3e658d5
Merge pull request #1828 from MilosKozak/dev
MilosKozak Jun 20, 2016
d724965
Korean translation update
jungsomyeong Jun 26, 2016
47626ed
Merge pull request #1840 from jungsomyeong/patch-9
MilosKozak Jun 26, 2016
1b6909f
extend upbat plugin to show battery voltage in the tooltip if avaliable
jasoncalabrese Jul 9, 2016
1115b59
pin mongo version to 2.1.18 to hopefully fix issues with mlab
jasoncalabrese Jul 10, 2016
148ddf0
Merge pull request #1849 from nightscout/wip/battery-voltage
jasoncalabrese Jul 10, 2016
dfac548
pin mongodb driver to version 2.1.18; bump release version to 0.8.5
jasoncalabrese Jul 10, 2016
7861135
Merge pull request #1852 from nightscout/hotfix/mongo-pin
jasoncalabrese Jul 10, 2016
7cfb0b8
Update language.js
martijnmcb Jul 11, 2016
daff65b
Merge pull request #1854 from martijnmcb/patch-2
MilosKozak Jul 12, 2016
9f398bd
fix issue snooze where alarm doesn't get cleared
jasoncalabrese Jul 13, 2016
2539392
Fix swagger rendering
bewest Jul 21, 2016
4052f5c
Rus translation update
apanasef Jul 21, 2016
f0ed1a9
Merge pull request #1859 from apanasef/patch-10
MilosKozak Jul 22, 2016
80f5fbc
Merge pull request #1855 from nightscout/wip/stale-snooze
jasoncalabrese Jul 23, 2016
810b0e3
Update CONTRIBUTING.md
jasoncalabrese Jul 25, 2016
f4e1b30
use jwt to create authorized tokens for access keys
jasoncalabrese Jul 30, 2016
893a7c8
only create an access key if we have an api secret
jasoncalabrese Jul 30, 2016
3d88bd3
replace old wares.verifyAuthorization with ctx.authorization.isPermit…
jasoncalabrese Aug 1, 2016
f50e36d
connect an access token from the query string to a authorized token f…
jasoncalabrese Aug 1, 2016
afe346d
refresh auth when needed
jasoncalabrese Aug 1, 2016
8cdfb35
todo
jasoncalabrese Aug 1, 2016
301632e
rename keys to subjects; add nice token format: abbrev-mvV39izpW5
jasoncalabrese Aug 2, 2016
eb6d275
refactoring
jasoncalabrese Aug 2, 2016
15a3d8d
only set authorized.lat if authorized
jasoncalabrese Aug 2, 2016
d8de68c
create/list subjects from mongo
jasoncalabrese Aug 2, 2016
d24dbdb
Update language.js
baembel08 Aug 2, 2016
412eff1
Merge pull request #1869 from baembel08/patch-6
MilosKozak Aug 2, 2016
e8209a3
track whick permissions are checked and expose them with the api so w…
jasoncalabrese Aug 3, 2016
ab2facb
the beginig of subject/roles admin tools
jasoncalabrese Aug 3, 2016
658e374
better default anchor style
jasoncalabrese Aug 3, 2016
fb73906
allow temp basals for last two days
bewest Aug 3, 2016
683cb3b
Revert "allow temp basals for last two days"
bewest Aug 3, 2016
a947ecd
add subject delete
jasoncalabrese Aug 4, 2016
9d7f957
admin ui now works for creating, editing, and deleting subjects; some…
jasoncalabrese Aug 4, 2016
9ffb473
ui/api/storage crud for roles; some refactoring
jasoncalabrese Aug 4, 2016
75b467b
codacay warnings
jasoncalabrese Aug 4, 2016
5f4941f
admin page should work with tokens too, need to update other pages, r…
jasoncalabrese Aug 4, 2016
5abb480
assign authorized token object to serverSettings
bewest Aug 4, 2016
0f735d0
implement read-access against token, mod default
bewest Aug 4, 2016
835dcea
allow accessToken in query params to grant perms
bewest Aug 4, 2016
9ab8861
teach tests about readable default role
bewest Aug 5, 2016
3937f85
hex digest; readable by default; default role clean up; init clean up
jasoncalabrese Aug 5, 2016
714ebd1
check permissions on client to hide/show careportal and boluscalc
jasoncalabrese Aug 5, 2016
b3eff20
fix client side permissions check
jasoncalabrese Aug 5, 2016
bdc6940
hide/show lock if careportal is enabled and shown, but permissions ar…
jasoncalabrese Aug 5, 2016
32332b7
don't need an anchor for the lock yet
jasoncalabrese Aug 5, 2016
8c1548e
remove DEVICESTATUS_AUTH since it can be handled by default roles, ne…
jasoncalabrese Aug 5, 2016
37cde41
make codacy be quieter
bewest Aug 5, 2016
69e6be5
increase tests of status api a tad
bewest Aug 5, 2016
0d88b1b
tweak missing semicolon
bewest Aug 5, 2016
cf78f7a
add auth logging, fix problem with *:*:read granting permission to au…
jasoncalabrese Aug 6, 2016
b9fe327
hook up websocket api to new tokens; added headers to GETs; rework /a…
jasoncalabrese Aug 6, 2016
c5e5a0f
fix resolve with api-secret bug
jasoncalabrese Aug 6, 2016
35b447c
make verifyauth work more like before
jasoncalabrese Aug 6, 2016
b44780c
codacy
jasoncalabrese Aug 6, 2016
8b86bfa
deprecate TREATMENTS_AUTH; for backwards compat setting TREATMENTS_AU…
jasoncalabrese Aug 6, 2016
e087e2c
better logging for api-secret based auth
jasoncalabrese Aug 6, 2016
c4f0581
move the toolbar toggles till after auth
jasoncalabrese Aug 6, 2016
c005b40
broken test
bewest Aug 6, 2016
7326912
Merge branch 'wip/tokens' of github.com:nightscout/cgm-remote-monitor…
bewest Aug 6, 2016
f306c3e
better
jasoncalabrese Aug 6, 2016
7ff9f42
add slightly more tests for ddata
bewest Aug 6, 2016
46834c8
cleanup ddata tests a bit
bewest Aug 6, 2016
30e9507
comment out code for codacy
bewest Aug 6, 2016
0a77b90
allow UI tests to re-use/share more code
bewest Aug 6, 2016
26cf3af
fixes for getting secret hash from body; refactor/extend on the fly a…
jasoncalabrese Aug 7, 2016
7346fea
show edit button if api:treatments:update is allowed too; clean up
jasoncalabrese Aug 7, 2016
45b7549
another log tweak
jasoncalabrese Aug 7, 2016
708c9d9
move api-secret auth from careportal drawer to settings; better behav…
jasoncalabrese Aug 7, 2016
f40d29a
fix tests, cleanup
jasoncalabrese Aug 7, 2016
380363c
move call to client.afterAuth into callback
jasoncalabrese Aug 7, 2016
0860064
cleanup
jasoncalabrese Aug 7, 2016
212b27d
create/check shiroTries for each role independently since combining p…
jasoncalabrese Aug 7, 2016
a178e00
codacy
jasoncalabrese Aug 8, 2016
dc725a4
Set static serverSettings
ps2 Aug 8, 2016
e39ab7a
isolate effects of middleware from other routers
bewest Aug 8, 2016
980112c
Merge branch 'wip/tokens' of github.com:nightscout/cgm-remote-monitor…
bewest Aug 8, 2016
c2ff306
add slightly more authorized/unauthorized tests
bewest Aug 8, 2016
dfc2b10
Merge pull request #1876 from ps2/tokens
bewest Aug 8, 2016
7a3032e
make codacy happier
bewest Aug 9, 2016
2f0bbca
make codacy happier
bewest Aug 9, 2016
28ba2a8
css tweak for codacy
bewest Aug 9, 2016
62299ae
I forgot to remove the !important, but it wasn't needed after other c…
jasoncalabrese Aug 9, 2016
60e82a0
don't override default thresholds/enable with empty values
jasoncalabrese Aug 9, 2016
0f42e69
env: off/on are truthy sometimes
bewest Aug 9, 2016
b6b3733
starting loop plugin work
ps2 Aug 13, 2016
825658c
wip
ps2 Aug 13, 2016
c3bc9e1
Update readme, tests passing
ps2 Aug 13, 2016
ebae558
Show errors, and new symbol for open-looping
ps2 Aug 14, 2016
e9502fa
Remove unused code
ps2 Aug 14, 2016
2a33b60
Add units to temp basal, IOB, and COB
ps2 Aug 14, 2016
0a981bd
Show last temp when subsequent loops have no recommendation/temp
ps2 Aug 15, 2016
e79622d
Add note about SHOW_FORECAST env var
ps2 Aug 15, 2016
ba94795
Use loop name in pill, and fix variable shadowing
ps2 Aug 15, 2016
f2adaa3
Fix codacy warnings
ps2 Aug 19, 2016
6be0e00
more codacy changes
ps2 Aug 19, 2016
3540adc
split out function with high cyclomatic complexity into separate func…
ps2 Aug 20, 2016
0c0f72a
Merge pull request #1896 from ps2/loop-plugin
jasoncalabrese Aug 20, 2016
79904bd
Merge branch 'dev' into wip/tokens
jasoncalabrese Aug 20, 2016
f8b5138
add noDateFilter option for small admin collections
jasoncalabrese Aug 20, 2016
b35a38a
Merge pull request #1868 from nightscout/wip/tokens
jasoncalabrese Aug 20, 2016
d41ab2c
Fix API for broken insulin data; treatments data processing when IOB …
sulkaharo Aug 22, 2016
f107fd6
Merge pull request #1903 from sulkaharo/wip/smallfixes
sulkaharo Aug 22, 2016
a4b5192
show auth dialog when clicking lock icon
jasoncalabrese Aug 23, 2016
3d00e8a
fix conflicts from master to dev from last hot fix
jasoncalabrese Aug 23, 2016
23ceeea
Merge pull request #1904 from nightscout/wip/lock-auth
jasoncalabrese Aug 23, 2016
e1ebbd4
Merge pull request #1905 from nightscout/wip/merge-master
jasoncalabrese Aug 23, 2016
91658d9
Show last predicted, even if lastLoop doesn't have a prediction
ps2 Aug 23, 2016
7687867
new bgnow plugin that will use bucketing for multi-cgm support to fin…
jasoncalabrese Aug 29, 2016
2ac479c
remove some debug
jasoncalabrese Aug 29, 2016
ba08f64
use bgnow buckets in place of old delta; fix tests
jasoncalabrese Sep 1, 2016
38395f5
no more USE_RAW option for AR2, added too much complexity and was so …
jasoncalabrese Sep 1, 2016
a2a67d6
Formatting fixes for loop section of readme
ps2 Sep 1, 2016
144a8bf
Merge pull request #1906 from ps2/loop-last-predicted
jasoncalabrese Sep 2, 2016
978ab95
a new sbx for now, updated only with data updates, not scrolling
jasoncalabrese Sep 3, 2016
8cf0723
show extended pump properties
MilosKozak Sep 4, 2016
54d552b
Merge branch 'dev' of https://github.com/nightscout/cgm-remote-monito…
MilosKozak Sep 4, 2016
d86a0c1
Merge pull request #1923 from MilosKozak/dev
MilosKozak Sep 4, 2016
4d56afb
offset buckets 2.5mins; some extra debug logging; better checking
jasoncalabrese Sep 4, 2016
bf82675
clean up
jasoncalabrese Sep 4, 2016
f3144be
expose most recent and previous buckets with sgvs so AR2 can just use it
jasoncalabrese Sep 5, 2016
f602bcc
clean up loging
jasoncalabrese Sep 5, 2016
f37bfdf
make current basal available as a property
jasoncalabrese Sep 7, 2016
93d1611
support for using stored apisecret in denied mode and add auth header…
jasoncalabrese Sep 9, 2016
f1ba301
support scanning and removing more than 10 future records
scottleibrand Sep 10, 2016
437ba42
bind to ipv6 socket
scottleibrand Sep 10, 2016
b6c2795
handle case of openaps: { iob: null,
scottleibrand Sep 10, 2016
95435f9
Merge branch 'dev' of github.com:nightscout/cgm-remote-monitor into dev
scottleibrand Sep 10, 2016
fd29a16
pretty=true support for properties api
jasoncalabrese Sep 14, 2016
901bec8
clean up, hopefully a fix for null meanBy bug
jasoncalabrese Sep 14, 2016
a935112
split up the bgnow property so there's a simple delta; more clean up
jasoncalabrese Sep 14, 2016
0cef302
fix sandbox delta tests
jasoncalabrese Sep 14, 2016
11a3931
;
jasoncalabrese Sep 14, 2016
fcc37f0
still seeing unexplained nulls from _.meanBy, using a custom function…
jasoncalabrese Sep 14, 2016
559ac04
multi rig uploader battery support including alerts
jasoncalabrese Sep 22, 2016
82a4e83
add status to property/fix test
jasoncalabrese Sep 24, 2016
1ec7942
use prop.min.notification for notification, after restructing prop
jasoncalabrese Sep 24, 2016
ea92ae3
removing mongodb3.x dependencies
Sep 29, 2016
e461f83
use status.json instead of status.js and wait for it to load
jasoncalabrese Oct 1, 2016
4f86330
some magic to make tests work with status.json request
jasoncalabrese Oct 1, 2016
370559e
shuffle things around to get apisecret auth working in denied mode wi…
jasoncalabrese Oct 1, 2016
85dae2b
don't forget to pass the callback when running init again after auth
jasoncalabrese Oct 1, 2016
c4b767b
move callback to post socket connect so we can handle status-only mode
jasoncalabrese Oct 1, 2016
ce7ea32
Merge pull request #1996 from SandraK82/dev
jasoncalabrese Oct 1, 2016
b41703b
toFixed(2) on basal label
MilosKozak Oct 2, 2016
4c36d31
remove basal labels in reports
MilosKozak Oct 2, 2016
e35ee7e
toFixed(2) on insulin labels in reports
MilosKozak Oct 2, 2016
cb0b98f
Merge pull request #2012 from MilosKozak/dev
MilosKozak Oct 2, 2016
e787a09
Merge pull request #1919 from nightscout/wip/buckets
jasoncalabrese Oct 7, 2016
2e039c0
Merge branch 'dev' into wip/basal-property
jasoncalabrese Oct 8, 2016
3443920
add display value for basal property; some clean up
jasoncalabrese Oct 8, 2016
51d7368
look for Loop iob
jasoncalabrese Oct 8, 2016
5c2b70c
fix basal test
jasoncalabrese Oct 8, 2016
0e46e7a
fix bug with loop iob
jasoncalabrese Oct 8, 2016
9253c7b
Merge pull request #2047 from nightscout/wip/basal-property
jasoncalabrese Oct 8, 2016
e7b2a12
merge in dev and fix test problems with more socket mocking
jasoncalabrese Oct 9, 2016
c2d9842
missing :'s
jasoncalabrese Oct 9, 2016
46bc6ed
add option for add a requiredPermission to the client, use that for a…
jasoncalabrese Oct 9, 2016
251fbe6
bump version to 0.9.0-dev-20161008
jasoncalabrese Oct 9, 2016
6e6aa11
make sure theres an apisecret before checking it's length
jasoncalabrese Oct 9, 2016
6ba73ba
Merge pull request #2003 from nightscout/wip/status-denied
jasoncalabrese Oct 9, 2016
7b4930b
Merge branch 'dev' into tenfutureitems
jasoncalabrese Oct 9, 2016
a1a1b91
add new HOSTNAME env setting that can be used limit the hostname node…
jasoncalabrese Oct 9, 2016
78b3366
Use findOneAndUpdate to get object id of newly created or updated record
ps2 Oct 9, 2016
2dcfcfe
Revert whitespace changes
ps2 Oct 9, 2016
ac56369
Revert whitespace changes
ps2 Oct 9, 2016
e70e086
Use update()
ps2 Oct 9, 2016
22b2551
Remove unused 'new' option
ps2 Oct 10, 2016
1711ae3
Avoid shadowing results var
ps2 Oct 10, 2016
bef5eae
Merge pull request #1944 from nightscout/tenfutureitems
jasoncalabrese Oct 10, 2016
ab9c5fd
Merge pull request #2058 from ps2/return-treatment-ids
jasoncalabrese Oct 10, 2016
240ebfa
version bump to 0.9.0-dev-20161009
jasoncalabrese Oct 10, 2016
18aa429
request retro data on demand
jasoncalabrese Oct 10, 2016
7020a0c
add missing languages to azure deploy
MilosKozak Oct 10, 2016
da2a88f
reformat idents
MilosKozak Oct 10, 2016
4b0d1d8
add DEVICESTATUS_ADVANCED to azure deploy
MilosKozak Oct 10, 2016
3f0281f
remote TREATMENTS_AUTH from azure deploy
MilosKozak Oct 10, 2016
987338b
update basal_render in azure deploy
MilosKozak Oct 10, 2016
196647e
add PROFILE_MULTIPLE to azure deploy
MilosKozak Oct 10, 2016
b2695c1
add SCALE_Y to azure deploy
MilosKozak Oct 10, 2016
2cb597d
only send most recent devicestatus to the client; load the rest when/…
jasoncalabrese Oct 10, 2016
cd5e773
add missing loaded callback for the profile editor
jasoncalabrese Oct 10, 2016
00d565c
Merge pull request #2061 from nightscout/wip/fix-profileedit
jasoncalabrese Oct 10, 2016
aa48296
Merge branch 'dev' into wip/recent-till-retro
jasoncalabrese Oct 10, 2016
3ae2304
Merge pull request #2060 from MilosKozak/master
MilosKozak Oct 10, 2016
bd1f7eb
remove the 3rd(last) data bucket since it was empty after moving devi…
jasoncalabrese Oct 10, 2016
b89007f
remove check for last
jasoncalabrese Oct 10, 2016
299ef2e
bump version to 0.9.0-dev-20161010
jasoncalabrese Oct 11, 2016
e0d0a98
Merge pull request #2062 from nightscout/wip/recent-till-retro
jasoncalabrese Oct 11, 2016
7261721
Only render day to day reports and treatment editing UI if user wants…
sulkaharo Oct 11, 2016
a94ab99
Bump the max reporting months to 6
sulkaharo Oct 11, 2016
c2181c6
fix test reports test
jasoncalabrese Oct 12, 2016
b76dfcf
Merge pull request #2070 from nightscout/wip/speedupreporting
jasoncalabrese Oct 12, 2016
87660c2
Fix first delta (was comparing a string to Mongo object ID using === …
sulkaharo Oct 12, 2016
86d15e1
Merge pull request #2072 from sulkaharo/wip/fixfirstdelta
jasoncalabrese Oct 12, 2016
217dc39
bump version to 0.9.0-dev-20161012
jasoncalabrese Oct 12, 2016
faf5f93
version bump for Nightscout Grilled Cheese 0.9
jasoncalabrese Oct 14, 2016
891d67c
Merge pull request #2076 from nightscout/dev
jasoncalabrese Oct 14, 2016
ac237b9
Update language.js
baembel08 Oct 15, 2016
a00c5dc
Merge pull request #2090 from baembel08/patch-1
MilosKozak Oct 15, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix more tests
jasoncalabrese committed Jun 8, 2016
commit e3d1b58fdc5554a932fe3803b17524c59281503a
5 changes: 0 additions & 5 deletions tests/api.treatments.test.js
Original file line number Diff line number Diff line change
@@ -76,13 +76,8 @@ describe('Treatment API', function ( ) {

self.ctx.bus.on('data-loaded', function dataWasLoaded ( ) {
self.ctx.ddata.treatments.length.should.equal(3);
self.ctx.ddata.treatments[0].mgdl.should.equal(100);
should.not.exist(self.ctx.ddata.treatments[0].eventTime);
should.not.exist(self.ctx.ddata.treatments[0].notes);

should.not.exist(self.ctx.ddata.treatments[1].eventTime);
self.ctx.ddata.treatments[1].insulin.should.equal(2);
self.ctx.ddata.treatments[2].carbs.should.equal(30);

//if travis is slow the 2 posts take long enough that 2 data-loaded events are emitted
if (!doneCalled) { done(); }
7 changes: 2 additions & 5 deletions tests/profileeditor.test.js
Original file line number Diff line number Diff line change
@@ -6,11 +6,8 @@ var benv = require('benv');
var read = require('fs').readFileSync;
var serverSettings = require('./fixtures/default-server-settings');

var nowData = {
sgvs: [
{ mgdl: 100, mills: Date.now(), direction: 'Flat', type: 'sgv' }
]
};
var nowData = require('../lib/data/ddata')();
nowData.sgvs.push({ mgdl: 100, mills: Date.now(), direction: 'Flat', type: 'sgv' });

var exampleProfile = {
defaultProfile : 'Default'