From 64d7933e667c77811a6715de219c76052ef817a2 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Thu, 25 Jun 2015 09:01:17 -0700 Subject: [PATCH] [ReactNative] Ignore _UILayoutGuide in tests --- Libraries/RCTTest/RCTTestRunner.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Libraries/RCTTest/RCTTestRunner.m b/Libraries/RCTTest/RCTTestRunner.m index 0ab8c0555..73f88d5ed 100644 --- a/Libraries/RCTTest/RCTTestRunner.m +++ b/Libraries/RCTTest/RCTTestRunner.m @@ -99,7 +99,14 @@ RCT_NOT_IMPLEMENTED(-init) error = [[RCTRedBox sharedInstance] currentErrorMessage]; } [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; [[RCTRedBox sharedInstance] dismiss]; if (expectErrorBlock) {