diff options
author | Jason Wray <jason@mapbox.com> | 2019-06-11 16:16:38 -0700 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2019-06-21 16:57:07 -0700 |
commit | b9a7063e74b953bcc192de9119cddcab161482c5 (patch) | |
tree | 1f84e172703ffe16204d94b03703f1ae01244f7c | |
parent | 2d66f7d67e47b1ea620ce1ee8b999c757b05579e (diff) | |
download | qtlocation-mapboxgl-b9a7063e74b953bcc192de9119cddcab161482c5.tar.gz |
Convert integration test to completionful expectation
-rw-r--r-- | platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m b/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m index 0b32df55b4..9e298140c0 100644 --- a/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m +++ b/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m @@ -112,13 +112,16 @@ static const CGFloat kAnnotationScale = 0.125f; // Also note, that at this point, the internal mechanism that determines if // an annotation view is offscreen and should be put back in the reuse queue // will have run, and `viewForAnnotation` may return nil - - [self.mapView selectAnnotation:point moveIntoView:moveIntoView animateSelection:animateSelection]; + + XCTestExpectation *selectionCompleted = [self expectationWithDescription:@"Selection completed"]; + [self.mapView selectAnnotation:point moveIntoView:moveIntoView animateSelection:animateSelection completionHandler:^{ + [selectionCompleted fulfill]; + }]; // Animated selection takes MGLAnimationDuration (0.3 seconds), so wait a little // longer. We don't need to wait as long if we're not animated (but we do // want the runloop to tick over) - [self waitFor:animateSelection ? 0.4: 0.05]; + [self waitForExpectations:@[selectionCompleted] timeout:animateSelection ? 0.4: 0.05]; UIView *annotationViewAfterSelection = [self.mapView viewForAnnotation:point]; CLLocationCoordinate2D mapCenterAfterSelection = self.mapView.centerCoordinate; |