Skip to content

Commit

Permalink
Add empty children test for partition layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondavies committed Sep 8, 2011
1 parent 1873142 commit 3b629b4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/layout/partition-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ suite.addBatch({
{x: 3, y: 2, dx: 0, dy: 1},
{x: 3, y: 2, dx: 0, dy: 1}
]);
},
"can handle an empty children array": function(partition) {
var p = partition();
assert.deepEqual(p({children: []}).map(metadata), [
{x: 0, y: 0, dx: 1, dy: 1}
]);
assert.deepEqual(p({children: [{children: []}, {value: 1}]}).map(metadata), [
{x: 0, y: 0, dx: 1, dy: 0.5},
{x: 1, y: 0.5, dx: 0, dy: 0.5},
{x: 0, y: 0.5, dx: 1, dy: 0.5}
]);
}
}
});
Expand Down

0 comments on commit 3b629b4

Please sign in to comment.