[ReactNative] Ignore _UILayoutGuide in tests

This commit is contained in:
Alex Kotliarskyi 2015-06-25 09:01:17 -07:00
parent 7fc86dded3
commit 64d7933e66
1 changed files with 8 additions and 1 deletions

View File

@ -99,7 +99,14 @@ RCT_NOT_IMPLEMENTED(-init)
error = [[RCTRedBox sharedInstance] currentErrorMessage]; error = [[RCTRedBox sharedInstance] currentErrorMessage];
} }
[rootView removeFromSuperview]; [rootView removeFromSuperview];
RCTAssert(vc.view.subviews.count == 0, @"There shouldn't be any other views: %@", vc.view);
NSArray *nonLayoutSubviews = [vc.view.subviews filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id subview, NSDictionary *bindings) {
return ![NSStringFromClass([subview class]) isEqualToString:@"_UILayoutGuide"];
}]];
RCTAssert(nonLayoutSubviews.count == 0, @"There shouldn't be any other views: %@", nonLayoutSubviews);
vc.view = nil; vc.view = nil;
[[RCTRedBox sharedInstance] dismiss]; [[RCTRedBox sharedInstance] dismiss];
if (expectErrorBlock) { if (expectErrorBlock) {