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
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.
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.
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.
* 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
* 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
* * 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
* 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