better handling for padding in a top/bottom or left/right configuration

This commit is contained in:
Christopher Chedeau
2014-06-12 11:52:07 -07:00
parent 900beefa1e
commit a36820d15e
2 changed files with 39 additions and 8 deletions

View File

@@ -983,6 +983,28 @@ describe('Layout', function() {
);
});
it('should layout with position absolute left, right and width', function() {
testLayout(
{style: {}, children: [
{style: {left: 5, right: -1, width: 300, position: 'absolute'}}
]},
{width: 0, height: 0, top: 0, left: 0, children: [
{width: 300, height: 0, top: 0, left: 5}
]}
);
});
it('should layout with position absolute top, bottom and min padding', function() {
testLayout(
{style: {}, children: [
{style: {top: -5, bottom: -5, paddingTop: 5, position: 'absolute'}}
]},
{width: 0, height: 0, top: 0, left: 0, children: [
{width: 0, height: 10, top: -5, left: 0}
]}
);
});
xit('should layout text with alignItems: stretch', function() {
testLayout(
{style: {width: 80, padding: 7, alignItems: 'stretch', measure: text('loooooooooong with space')}},