From ed1a9f475c14a6c0b5aa5d09065df0b51b8087cf Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 14 Apr 2014 10:29:04 -0700 Subject: [PATCH] don't shrink children --- spec/LayoutSpec.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/spec/LayoutSpec.js b/spec/LayoutSpec.js index 92319b8a..dc7cde93 100755 --- a/spec/LayoutSpec.js +++ b/spec/LayoutSpec.js @@ -13,6 +13,7 @@ var iframe = (function() { display: flex; flex-direction: column; align-items: flex-start; + flex-shrink: 0; margin: 0; padding: 0; @@ -468,6 +469,22 @@ describe('Layout', function() { }); }); + it('should not shrink children if not enough space', function() { + testLayout({ + style: {height: 100}, + children: [ + {style: {height: 100}}, + {style: {height: 200}}, + ] + }, { + width: 0, height: 100, top: 0, left: 0, + children: [ + {width: 0, height: 100, top: 0, left: 0}, + {width: 0, height: 200, top: 100, left: 0} + ] + }); + }); + it('should layout randomly', function() { function RNG(seed) { this.state = seed; @@ -505,7 +522,7 @@ describe('Layout', function() { return node; } - for (var i = 0; i < 100; ++i) { + for (var i = 0; i < 1000; ++i) { var node = generateRandomNode(); expect({i: i, node: node, layout: computeLayout(node)}) .toEqual({i: i, node: node, layout: computeDOMLayout(node)});