Add extended configuration method with self as argument.
This commit is contained in:
@@ -22,6 +22,13 @@
|
||||
XCTAssertNoThrow([view configureLayoutWithBlock:block]);
|
||||
}
|
||||
|
||||
- (void)testConfigureContainerLayoutIsNoOpWithNilBlock
|
||||
{
|
||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
id block = nil;
|
||||
XCTAssertNoThrow([view configureLayoutWithContainerBlock:block]);
|
||||
}
|
||||
|
||||
- (void)testConfigureLayoutBlockWorksWithValidBlock
|
||||
{
|
||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
@@ -35,6 +42,20 @@
|
||||
XCTAssertEqual(view.yoga.width.value, 25);
|
||||
}
|
||||
|
||||
- (void)testConfigureContainerLayoutBlockWorksWithValidBlock
|
||||
{
|
||||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
[view configureLayoutWithContainerBlock:^(YGLayout *layout, UIView *container){
|
||||
XCTAssertNotNil(layout);
|
||||
XCTAssertTrue(view == container);
|
||||
layout.isEnabled = YES;
|
||||
layout.width = YGPointValue(25);
|
||||
}];
|
||||
|
||||
XCTAssertTrue(view.yoga.isEnabled);
|
||||
XCTAssertEqual(view.yoga.width.value, 25);
|
||||
}
|
||||
|
||||
- (void)testNodesAreDeallocedWithSingleView
|
||||
{
|
||||
__weak YGLayout *layoutRef = nil;
|
||||
|
Reference in New Issue
Block a user