Skip to content

Commit e9c0202

Browse files
committed
add calc test for count branches and leaves
1 parent e5181ac commit e9c0202

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

test/jasmine/tests/sunburst_test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,16 @@ describe('Test sunburst calc:', function() {
243243
var parents = ['', 'Root', 'Root', 'B'];
244244

245245
_calc([
246-
{labels: labels, parents: parents},
246+
{labels: labels, parents: parents, count: 'leaves+branches'},
247+
{labels: labels, parents: parents, count: 'branches'},
248+
{labels: labels, parents: parents}, // N.B. counts 'leaves' in this case
247249
{labels: labels, parents: parents, values: [0, 1, 2, 3]},
248250
{labels: labels, parents: parents, values: [30, 20, 10, 5], branchvalues: 'total'}
249251
]);
250252

251253
expect(extractPt('value')).toEqual([
254+
[4, 2, 1, 1],
255+
[2, 1, 0, 0],
252256
[2, 1, 1, 1],
253257
[6, 5, 1, 3],
254258
[30, 20, 10, 5]

test/jasmine/tests/treemap_test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,16 @@ describe('Test treemap calc:', function() {
358358
var parents = ['', 'Root', 'Root', 'B'];
359359

360360
_calc([
361-
{labels: labels, parents: parents},
361+
{labels: labels, parents: parents, count: 'leaves+branches'},
362+
{labels: labels, parents: parents, count: 'branches'},
363+
{labels: labels, parents: parents}, // N.B. counts 'leaves' in this case
362364
{labels: labels, parents: parents, values: [0, 1, 2, 3]},
363365
{labels: labels, parents: parents, values: [30, 20, 10, 5], branchvalues: 'total'}
364366
]);
365367

366368
expect(extractPt('value')).toEqual([
369+
[4, 2, 1, 1],
370+
[2, 1, 0, 0],
367371
[2, 1, 1, 1],
368372
[6, 5, 1, 3],
369373
[30, 20, 10, 5]

0 commit comments

Comments
 (0)