nested children

This commit is contained in:
Christopher Chedeau
2014-03-30 19:33:24 -07:00
parent 8713562160
commit cce3a4d830
3 changed files with 54 additions and 26 deletions

View File

@@ -88,7 +88,7 @@ describe('Layout', function() {
testLayout({
style: {width: 100, height: 200}
}, {
width: 100, height: 200, left: 0, top: 0
width: 100, height: 200, top: 0, left: 0
});
});
@@ -101,7 +101,7 @@ describe('Layout', function() {
{style: {width: 125, height: 125}}
]
}, {
width: 1000, height: 1000, left: 0, top: 0,
width: 1000, height: 1000, top: 0, left: 0,
children: [
{width: 500, height: 500, top: 0, left: 0},
{width: 250, height: 250, top: 500, left: 0},
@@ -109,5 +109,31 @@ describe('Layout', function() {
]
});
});
it('should layout node with nested children', function() {
testLayout({
style: {width: 1000, height: 1000},
children: [{
style: {width: 500, height: 500}
}, {
style: {width: 500, height: 500},
children: [
{style: {width: 250, height: 250}},
{style: {width: 250, height: 250}}
]
}]
}, {
width: 1000, height: 1000, top: 0, left: 0,
children: [{
width: 500, height: 500, top: 0, left: 0
}, {
width: 500, height: 500, top: 500, left: 0,
children: [
{width: 250, height: 250, top: 0, left: 0},
{width: 250, height: 250, top: 250, left: 0},
]
}]
});
});
});