Skip to content

Commit

Permalink
fix(DetoxActions): use is-hittable assertion before UI gestures.
Browse files Browse the repository at this point in the history
  • Loading branch information
asafkorem committed Dec 2, 2021
1 parent a45f6bd commit ca1cde1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion detox/ios/Detox/Actions/UIDatePicker+DetoxActions.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ @implementation UIDatePicker (DetoxActions)

- (void)dtx_adjustToDate:(NSDate*)date
{
[self dtx_assertVisible];
[self dtx_assertHittable];

NSDate* previousDate = self.date;

Expand Down
2 changes: 1 addition & 1 deletion detox/ios/Detox/Actions/UIPickerView+DetoxActions.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ @implementation UIPickerView (DetoxActions)

- (void)dtx_setComponent:(NSInteger)component toValue:(id)value
{
[self dtx_assertVisible];
[self dtx_assertHittable];

DTXViewAssert(self.dataSource != nil && self.delegate != nil, self.dtx_elementDebugAttributes, @"The picker view's data source and/or delegate are nil");

Expand Down
3 changes: 3 additions & 0 deletions detox/ios/Detox/Actions/UIScrollView+DetoxActions.m
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ - (void)_dtx_scrollWithOffset:(CGPoint)offset normalizedStartingPoint:(CGPoint)n
}

CGPoint startPoint = CGPointMake(safeAreaToScroll.origin.x + safeAreaToScroll.size.width * normalizedStartingPoint.x, safeAreaToScroll.origin.y + safeAreaToScroll.size.height * normalizedStartingPoint.y);


[self dtx_assertHittableAtPoint:startPoint];

NSUInteger successfullyAppliedScrolls = 0;
while (offset.x != 0.0 || offset.y != 0.0)
Expand Down

0 comments on commit ca1cde1

Please sign in to comment.