support position: absolute without top/left/bottom/right set

This commit is contained in:
Christopher Chedeau
2014-04-21 14:29:17 -07:00
parent 901db3c3a6
commit ddcca9107b
2 changed files with 29 additions and 3 deletions

View File

@@ -467,6 +467,21 @@ describe('Layout', function() {
);
});
it('should layout node with position: absolute', function() {
testLayout(
{style: {width: 500, flexDirection: 'row'}, children: [
{style: {flex: 1}},
{style: {position: 'absolute', width: 50}},
{style: {flex: 1}},
]},
{width: 500, height: 0, top: 0, left: 0, children: [
{width: 250, height: 0, top: 0, left: 0},
{width: 50, height: 0, top: 0, left: 250},
{width: 250, height: 0, top: 0, left: 250}
]}
);
});
it('should layout randomly', function() {
function RNG(seed) {
this.state = seed;
@@ -518,7 +533,7 @@ describe('Layout', function() {
randEnum(node, 0.1, 'alignItems', ['flex-start', 'center', 'flex-end', 'stretch']);
randEnum(node, 0.1, 'alignSelf', ['flex-start', 'center', 'flex-end', 'stretch']);
randEnum(node, 0.1, 'flex', ['none', 1]);
// randEnum(node, 0.1, 'position', ['relative', 'absolute']);
randEnum(node, 0.1, 'position', ['relative', 'absolute']);
randChildren(node, 0.2);
return node;
}