-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_SingleDrawer.js
33 lines (24 loc) · 1.17 KB
/
test_SingleDrawer.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
var assert = require('assert');
import {SingleDrawer} from '../../js/drawer/SingleDrawer';
import * as Constants from '../../js/Constants';
import sinon from 'sinon';
import packers from 'binpacking';
// mock GrowingPacker because it's imported with script-tag
SingleDrawer.prototype._getPacker = sinon.stub().returns(packers.GrowingPacker.prototype);
var elements = require('../data/deltaTreeWithCalculatedGroundAreas.json');
describe('SingleDrawer', function () {
it('should draw the correct amount of elements', function () {
var drawer = new SingleDrawer(null, Constants.LEFT_SCREEN, {});
// stubbing
SingleDrawer.prototype.drawBlock = sinon.stub().returns('yalla yalla');
drawer.drawElements(elements);
sinon.assert.callCount(drawer.drawBlock, 8); // 5 files + 3 modules
});
it('should draw the correct amount of elements', function () {
var drawer = new SingleDrawer(null, Constants.RIGHT_SCREEN, {});
// stubbing
SingleDrawer.prototype.drawBlock = sinon.stub().returns('yalla yalla');
drawer.drawElements(elements);
sinon.assert.callCount(drawer.drawBlock, 8); // 5 files + 3 modules
});
});