support <Text>

This commit is contained in:
Christopher Chedeau
2014-04-26 19:02:16 -07:00
parent 61919a1b2f
commit a0ffafe37d
3 changed files with 40 additions and 7 deletions

View File

@@ -745,7 +745,7 @@ describe('Layout', function() {
)
});
it('should layout node with text', function() {
it('should layout node with just text', function() {
testLayout(
{style: {measure: text('kikoo')}},
{width: 36, height: 18, top: 0, left: 0}
@@ -759,13 +759,24 @@ describe('Layout', function() {
)
});
it('should layout node with padding and margin', function() {
it('should layout node with text, padding and margin', function() {
testLayout(
{style: {measure: text('kikoo loool'), padding: 5, margin: 5}},
{width: 82, height: 28, top: 5, left: 5}
)
});
it('should layout node with text and position absolute', function() {
testLayout(
{style: {}, children: [
{style: {measure: text('kikoo loool'), position: 'absolute'}}
]},
{width: 0, height: 0, top: 0, left: 0, children: [
{width: 36, height: 36, top: 0, left: 0}
]}
)
});
it('should layout randomly', function() {