mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
* 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
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
var _ = require('lodash');
|
|
var language = require('../lib/language')();
|
|
|
|
describe('Clean MONGO after tests', function ( ) {
|
|
this.timeout(10000);
|
|
var self = this;
|
|
|
|
var api = require('../lib/api/');
|
|
beforeEach(function (done) {
|
|
process.env.API_SECRET = 'this is my long pass phrase';
|
|
self.env = require('../env')();
|
|
self.env.settings.authDefaultRoles = 'readable';
|
|
self.env.settings.enable = ['careportal', 'api'];
|
|
this.wares = require('../lib/middleware/')(self.env);
|
|
self.app = require('express')();
|
|
self.app.enable('api');
|
|
require('../lib/server/bootevent')(self.env, language).boot(function booted(ctx) {
|
|
self.ctx = ctx;
|
|
self.ctx.ddata = require('../lib/data/ddata')();
|
|
self.app.use('/api', api(self.env, ctx));
|
|
done();
|
|
});
|
|
});
|
|
|
|
it('wipe treatment data', function (done) {
|
|
self.ctx.treatments().remove({ }, function ( ) {
|
|
done();
|
|
});
|
|
});
|
|
|
|
it('wipe entries data', function (done) {
|
|
self.ctx.entries().remove({ }, function ( ) {
|
|
done();
|
|
});
|
|
});
|
|
|
|
});
|