Add unit test. Fix the layout for non-UIView subclasses

This commit is contained in:
Pavel Mazurin
2017-07-31 15:43:15 +02:00
parent 010d1bb0c2
commit 6366ee45ab
2 changed files with 12 additions and 1 deletions

View File

@@ -129,6 +129,16 @@
XCTAssertEqual(longTextLabelSize.width + textBadgeView.yoga.intrinsicSize.width, containerSize.width);
}
- (void)testSizeThatFitsEmptyView
{
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 200, 200)];
view.yoga.isEnabled = YES;
const CGSize viewSize = view.yoga.intrinsicSize;
XCTAssertEqual(viewSize.height, 0);
XCTAssertEqual(viewSize.width, 0);
}
- (void)testPreservingOrigin
{
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,50,75)];