mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-24 03:45:58 +08:00
Set .flexShrink to YES by default (#2247)
To align with the CSS flex-shrink spec, set the default value of flexShrink to YES: http://www.w3.org/TR/css-flexbox-1/#propdef-flex-shrink
This commit is contained in:
@@ -48,6 +48,19 @@ static void setCGSizeToNode(CGSize size, ASDisplayNode *node)
|
||||
node.height = ASDimensionMakeWithPoints(size.height);
|
||||
}
|
||||
|
||||
- (void)testDefaultStackLayoutableFlexProperties
|
||||
{
|
||||
ASDisplayNode *displayNode = [[ASDisplayNode alloc] init];
|
||||
|
||||
XCTAssertEqual(displayNode.flexShrink, YES);
|
||||
XCTAssertEqual(displayNode.flexGrow, NO);
|
||||
|
||||
const ASDimension unconstrainedDimension = ASDimensionUnconstrained;
|
||||
const ASDimension flexBasis = displayNode.flexBasis;
|
||||
XCTAssertEqual(flexBasis.type, unconstrainedDimension.type);
|
||||
XCTAssertEqual(flexBasis.value, unconstrainedDimension.value);
|
||||
}
|
||||
|
||||
- (void)testStackLayoutSpecWithJustify:(ASStackLayoutJustifyContent)justify
|
||||
flex:(BOOL)flex
|
||||
sizeRange:(ASSizeRange)sizeRange
|
||||
|
||||
Reference in New Issue
Block a user