Skip to content

Commit 3b629b4

Browse files
committed
Add empty children test for partition layout.
1 parent 1873142 commit 3b629b4

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/layout/partition-test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ suite.addBatch({
2323
{x: 3, y: 2, dx: 0, dy: 1},
2424
{x: 3, y: 2, dx: 0, dy: 1}
2525
]);
26+
},
27+
"can handle an empty children array": function(partition) {
28+
var p = partition();
29+
assert.deepEqual(p({children: []}).map(metadata), [
30+
{x: 0, y: 0, dx: 1, dy: 1}
31+
]);
32+
assert.deepEqual(p({children: [{children: []}, {value: 1}]}).map(metadata), [
33+
{x: 0, y: 0, dx: 1, dy: 0.5},
34+
{x: 1, y: 0.5, dx: 0, dy: 0.5},
35+
{x: 0, y: 0.5, dx: 1, dy: 0.5}
36+
]);
2637
}
2738
}
2839
});

0 commit comments

Comments
 (0)