mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
[ReactNative] Fix sample app tests
Summary: @public After the refactor on RCTText, update the SampleApp's test to use the accessibilityLabel instead of attributedText Test Plan: Run the SampleApp tets
This commit is contained in:
@@ -50,11 +50,8 @@
|
|||||||
redboxError = [[RCTRedBox sharedInstance] currentErrorMessage];
|
redboxError = [[RCTRedBox sharedInstance] currentErrorMessage];
|
||||||
|
|
||||||
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
|
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
|
||||||
if ([view respondsToSelector:@selector(attributedText)]) {
|
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
|
||||||
NSString *text = [(id)view attributedText].string;
|
return YES;
|
||||||
if ([text isEqualToString:TEXT_TO_LOOK_FOR]) {
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}];
|
}];
|
||||||
|
|||||||
Reference in New Issue
Block a user