Files
cgm-remote-monitor/tests/pluginbase.test.js
T
PieterGit cbee7f2a48 pluginbase.test.js fails with 30 sec. upping to 40 sec timeout
```
not ok 188 pluginbase "before each" hook for "does stuff"
 Error: timeout of 30000ms exceeded. Ensure the done() callback is being called in this test.
```
2017-10-22 02:01:10 +02:00

61 lines
1.3 KiB
JavaScript

'use strict';
require('should');
var benv = require('benv');
describe('pluginbase', function ( ) {
this.timeout(40000); // TODO: see why this test takes longer on Travis to complete
var headless = require('./fixtures/headless')(benv, this);
before(function (done) {
done( );
});
after(function (done) {
done( );
});
beforeEach(function (done) {
headless.setup({ }, done);
});
afterEach(function (done) {
headless.teardown( );
done( );
});
it('does stuff', function() {
function div (clazz) {
return $('<div class="' + clazz + '"></div>');
}
var container = div('container')
, bgStatus = div('bgStatus').appendTo(container)
, majorPills = div('majorPills').appendTo(bgStatus)
, minorPills = div('minorPills').appendTo(bgStatus)
, statusPills = div('statusPills').appendTo(bgStatus)
, tooltip = div('tooltip').appendTo(container)
;
var fake = {
name: 'fake'
, label: 'Insulin-on-Board'
, pluginType: 'pill-major'
};
var pluginbase = require('../lib/plugins/pluginbase')(majorPills, minorPills, statusPills, bgStatus, tooltip);
pluginbase.updatePillText(fake, {
value: '123'
, label: 'TEST'
, info: [{label: 'Label', value: 'Value'}]
});
majorPills.length.should.equal(1);
});
});