forked from nightscout/cgm-remote-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpluginbase.test.js
60 lines (44 loc) · 1.32 KB
/
pluginbase.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
'use strict';
require('should');
var benv = require('benv');
describe('pluginbase', function ( ) {
this.timeout(50000); // 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);
});
});