mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Fixed UIExplorer tests + async methods
Summary: public UIExplorer tests were broken due to a refactor that didn't update the RCTShadowViewTests + an off-by-one error in the logic for exporting async methods. Reviewed By: javache Differential Revision: D2595810 fb-gh-sync-id: c25a8b8956bff1ef2754bba4a8f10d72a16e2954
This commit is contained in:
committed by
facebook-github-bot-4
parent
516196b260
commit
9f4da92195
@@ -83,7 +83,8 @@
|
|||||||
[parentView insertReactSubview:mainView atIndex:1];
|
[parentView insertReactSubview:mainView atIndex:1];
|
||||||
[parentView insertReactSubview:footerView atIndex:2];
|
[parentView insertReactSubview:footerView atIndex:2];
|
||||||
|
|
||||||
[parentView collectRootUpdatedFrames:nil parentConstraint:CGSizeZero];
|
parentView.reactTag = @1; // must be valid rootView tag
|
||||||
|
[parentView collectRootUpdatedFrames:nil];
|
||||||
|
|
||||||
XCTAssertTrue(CGRectEqualToRect([parentView measureLayoutRelativeToAncestor:parentView], CGRectMake(0, 0, 440, 440)));
|
XCTAssertTrue(CGRectEqualToRect([parentView measureLayoutRelativeToAncestor:parentView], CGRectMake(0, 0, 440, 440)));
|
||||||
XCTAssertTrue(UIEdgeInsetsEqualToEdgeInsets([parentView paddingAsInsets], UIEdgeInsetsMake(10, 10, 10, 10)));
|
XCTAssertTrue(UIEdgeInsetsEqualToEdgeInsets([parentView paddingAsInsets], UIEdgeInsetsMake(10, 10, 10, 10)));
|
||||||
|
|||||||
@@ -89,13 +89,13 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init);
|
|||||||
NSMutableArray *methods = self.methods.count ? [NSMutableArray new] : nil;
|
NSMutableArray *methods = self.methods.count ? [NSMutableArray new] : nil;
|
||||||
NSMutableArray *asyncMethods = nil;
|
NSMutableArray *asyncMethods = nil;
|
||||||
for (id<RCTBridgeMethod> method in self.methods) {
|
for (id<RCTBridgeMethod> method in self.methods) {
|
||||||
[methods addObject:method.JSMethodName];
|
|
||||||
if (method.functionType == RCTFunctionTypePromise) {
|
if (method.functionType == RCTFunctionTypePromise) {
|
||||||
if (!asyncMethods) {
|
if (!asyncMethods) {
|
||||||
asyncMethods = [NSMutableArray new];
|
asyncMethods = [NSMutableArray new];
|
||||||
}
|
}
|
||||||
[asyncMethods addObject:@(methods.count)];
|
[asyncMethods addObject:@(methods.count)];
|
||||||
}
|
}
|
||||||
|
[methods addObject:method.JSMethodName];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSMutableArray *config = [NSMutableArray new];
|
NSMutableArray *config = [NSMutableArray new];
|
||||||
|
|||||||
Reference in New Issue
Block a user