Commit Graph
71 Commits
Author SHA1 Message Date
bewest 82708a5025 Make report tests less brittle by checking for colors instead of exact coordinates
Update tests in `tests/reports.test.js` to assert the presence of specific fill colors for chart elements rather than exact positional coordinates, improving test robustness against minor rendering variations.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 293138b2-b045-4ead-a559-d330e00bdd95
Replit-Helium-Checkpoint-Created: true
2026-01-20 02:05:33 +00:00
Ben West 93df3c4f09 cheat for tests across different time zones
There is a bug generating the window for time ranges across different
timezones, which results in different queries wrapping around day boundaries.
This provides the fixture with three variants of the queries, in some ways
better documenting the bug, and allowing the tests to pass.
2023-02-21 09:29:44 -08:00
Ben West a805939371 fix test with fixtures both ways 2023-01-27 10:16:56 -08:00
Ben West 10dd236cda daytoday: Align start of day with data across zones
This change correctly aligns the name of the day in the
current zone with the start of the data for the
equivalent day in the profile's zone.  This makes it so
that viewing a day to day report in any timezone works
going both east and west directions.
2023-01-26 12:52:32 -08:00
Ben West f6b2d4f717 Revert "Revert "clock at the end of the day is 23:59:59.999""
This reverts commit a4f92713c4.
2023-01-26 11:43:43 -08:00
Ben West a4f92713c4 Revert "clock at the end of the day is 23:59:59.999"
This reverts commit f51fac9623.
2023-01-26 11:42:36 -08:00
Ben West f51fac9623 clock at the end of the day is 23:59:59.999
Ensure that the test fixtures will return; the previous changes
correctly forward the time to end of day across zones and
datelines.  One side effect  is that the date formatted for the end
of the day uses all the microseconds for the day as well.  This
changes the query from the form of 23:59:59.000Z to 23:59:59.999Z.
This also ensures that anything that happens during that one second
will be included rather than excluded.
2023-01-24 09:56:49 -08:00
Sulka HaroandGitHub 647ed20de1 Clean statics & bundle more (#6745)
* * Remove unused old version of MFB
* Bundle food, profile editor
* Clean up the static folders

* Fix tests
2021-01-17 12:20:48 +02:00
Sulka HaroandGitHub 914ba78f36 Security improvement batch (#6622)
* Adds a new method for the server to push notifies to the client, which require administration privileges from the user. If there are messages in queue but user is not privileged, she is notified of pending messages

* Fix unit tests

* Increase timeouts on tests

* Add translations

* * Aggregate admin messages
* Send admin message on auth fail
* Sending messages over bus
* XSS filtering of objects sent over the REST API

* Warn users if their instance is world readable

* Fix adminnotifies init()

* Fix couple issues from Codacy
2021-01-07 22:46:55 +02:00
Sulka Haro df6d9aadc3 Re-enable partial report test 2021-01-07 14:45:13 +02:00
Sulka Haro a0738414f2 Oops, push the unit test changes as well 2020-12-14 22:08:53 +02:00
Sulka HaroandGitHub 7fe8e32152 Refactor core auth (#6596)
* Auth resolve now supports async/await
* Read only tokens can be used for authentication and the UI shows privileges for these accounts correctly
* Failed attempt at authenticating an API_SECRET or token delays subsequent auth attempt by 5000 ms
2020-12-11 00:23:25 +02:00
Sulka Haro 8a1d6bf84a Fix reports unit test 2020-09-16 11:46:22 +03:00
JakobandSulka Haro 5c152438e0 Restore glucose distribution test (#5434) 2020-01-12 18:39:36 +00:00
Sulka HaroandGitHub e10d4838a8 Fix tests failing in dev (#5127)
* * Fix reporting test to match the new output
* Fix number formatter to return the expected 0 when data is NaN
* Remove excessive logging during test runs from cob plugin

* Run all tests in one go

* Fixes D3 invocations for tests. Note this also removes transition timers (most of which seemed to be timed so fast they actually had no effect as the timer was faster than what it takes to draw a frame in Nightscout)

* Run tests independently

* Try not running tap-set-exit

* Remove tap-set-exit
2019-10-22 00:10:06 +03:00
Jeremy Cunningham d31099d73e Add unit test for weektoweek report 2018-12-05 21:50:21 -06:00
PieterGitandSulka Haro 71103bb4b7 resolve npm audit security fixes (#3721)
* upgrade mocha from 3.5.3 to 5.0.5

This resolves these security issues

  Low             Regular Expression Denial of Service
  Package         debug
  Dependency of   mocha [dev]
  Path            mocha > debug
  More info       https://nodesecurity.io/advisories/534

  Critical        Command Injection
  Package         growl
  Dependency of   mocha [dev]
  Path            mocha > growl
  More info       https://nodesecurity.io/advisories/146

* upgrade mocha and start modularizing lodash to make sure tests pass

* more lodash modularization

* upgrade mqtt to 2.18.3

* allow npm 6.2

* upgrade share2nightscout-bridge

* incorporate express-extension-to-accept into Nightscout

the packages seems not maintained (github page is 404) and has a security issue with mime package.  so upgraded and included into Nightscout code.

if somebody knows a more efficient way of programming this with express4 please PR

* update jsdom for security fixes

* prevent wrapping of hour labels by removing the space

* Revert "update jsdom for security fixes"

This reverts commit 04f1f39d636d8d79c6b01b5f298f9a6cea3dc645.

* Revert "more lodash modularization"

This reverts commit c4fa5304db9f16b94f15c2b44793a5a11d595885.

* remove forever dependency

* Revert "Revert "more lodash modularization""

This reverts commit b13c274ebff0b5c3a48ffc0e610ca85a9f8d25bc.

* fix report.test.js with newer packages

sometimes a fix is very easy. This is to prevent:

```
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: true, _useUTC: true, _l: undefined, _i: T00:00:00, _f: undefined, _strict: undefined, _locale: [object Object]
Error
    at Function.createFromInputFallback (XXX\cgm-remote-monitor\tmp\js\bundle.js:117408:98)
    at configFromString (XXX\cgm-remote-monitor\tmp\js\bundle.js:119456:15)
```

We must use ISO8601 formatted strings and not use slashes in dates, see https://github.com/moment/moment/issues/1407#issuecomment-155630060

* upgrade webpack to 4.16.2

* Update package.json
2018-07-24 20:25:44 +03:00
PieterGit 3d27c3bf0b temporary disable distrubition test, because it breaks travis 2018-06-24 14:41:24 +02:00
Sulka Haro 32273fdf20 Fix tests to uses the view path :D 2017-09-11 20:02:30 +03:00
Sulka Haro 7bef2216e2 Report tests takes over 40 seconds to run in Travis, timeout increased 2017-08-29 23:38:28 +03:00
Sulka Haro e39e1132ea Unit tests fixed 2017-08-29 22:59:55 +03:00
Sulka Haro 89cee93805 Fix battery icon, some tests 2017-08-21 18:02:27 +03:00
MilosKozak c7b1520002 fix report test 2017-06-15 22:07:52 +02:00
Jason Calabrese 6bbf32cde7 bump up report test timeout some more 2016-11-03 20:14:23 -07:00
Jason Calabrese 0a8e62018c higher test timeouts, only test with node 4 2016-10-28 17:41:15 -07:00
Jason Calabrese d59f5a8c71 get tests to pass with upgraded dependencies 2016-10-28 17:28:30 -07:00
Jason Calabrese d8b46eecdd refactor init so plugins can be localized 2016-10-15 10:54:20 -07:00
Jason Calabrese c2181c6a9b fix test reports test
and some minor clean up
2016-10-11 18:24:40 -07:00
Jason Calabrese e7b2a12f54 merge in dev and fix test problems with more socket mocking 2016-10-08 18:04:39 -07:00
Jason Calabrese 4f86330807 some magic to make tests work with status.json request 2016-09-30 22:10:08 -04:00
Ben West 0a77b90ecf allow UI tests to re-use/share more code
Tighten up the boilerplate a bit.
2016-08-06 16:56:03 -07:00
Mark Wilson d85d97ef53 Merge branch 'dev' of https://github.com/nightscout/cgm-remote-monitor into wip/iob-from-devicestatus 2016-03-30 13:07:55 -07:00
Mark Wilson b5d7b1b277 Fix mock $.ajax 2016-03-25 14:48:33 -07:00
MilosKozak dd1397dc7c codacy 2016-03-24 19:32:06 +01:00
MilosKozak 7a598b40fa test fix 2016-03-24 19:32:06 +01:00
MilosKozak 1ee0e4ba5f test fix pass 2 2015-10-17 22:00:54 +02:00
MilosKozak e30d7fb41e test fix pass 1 2015-10-17 21:53:07 +02:00
MilosKozak 13ebc66042 Basal & Temp Basal handling and visualisation 2015-10-17 18:34:29 +02:00
MilosKozak f60b9f551a fix test 2015-10-17 18:34:25 +02:00
MilosKozak 7923c8a567 disable log again 2015-09-29 14:40:22 +02:00
MilosKozak f5fbae9b25 report fix 2015-09-29 13:45:01 +02:00
Jason Calabrese 84254988ae mock dialog instead of pulling in jquery-ui and messing up coverage stats 2015-09-17 01:30:26 -07:00
MilosKozak ac37f5c1d3 remove todo, remove include from test 2015-09-16 00:24:49 +02:00
MilosKozak a53c3515de local test fix 2015-09-15 13:43:11 +02:00
MilosKozak 04056757b1 mock fail return status 2015-09-15 13:43:09 +02:00
MilosKozak 8662568641 add mock window.alert 2015-09-15 13:43:09 +02:00
MilosKozak 3fab1a55bb modify mock func 2015-09-15 13:43:08 +02:00
MilosKozak 8b7405265d unwanted space 2015-09-15 13:43:07 +02:00
MilosKozak 7b25a9dcdb .. and click save 2015-09-15 13:43:07 +02:00
MilosKozak 9fd1d0b9b5 try to click delete record 2015-09-15 13:43:06 +02:00