diff options
Diffstat (limited to 'platform/ios/uitest/MapViewTests.m')
-rw-r--r-- | platform/ios/uitest/MapViewTests.m | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/platform/ios/uitest/MapViewTests.m b/platform/ios/uitest/MapViewTests.m index 21310b47a6..3ed8c840f4 100644 --- a/platform/ios/uitest/MapViewTests.m +++ b/platform/ios/uitest/MapViewTests.m @@ -155,7 +155,7 @@ XCTAssertEqualObjects(MGLStringFromCoordinateBounds(initialBounds), MGLStringFromCoordinateBounds(tester.mapView.visibleCoordinateBounds), @"setting visible coordinate bounds to currently visible coordinate bounds should be a no-op"); - + // Roundtrip after zooming tester.mapView.zoomLevel -= 3; [tester.mapView setVisibleCoordinateBounds:initialBounds animated:NO]; @@ -171,7 +171,7 @@ @"after zooming in, setting visible coordinate bounds back to %@ should not leave them at %@", MGLStringFromCoordinateBounds(initialBounds), MGLStringFromCoordinateBounds(tester.mapView.visibleCoordinateBounds)); - + // Roundtrip after panning MGLCoordinateBounds offsetBounds = MGLCoordinateBoundsOffset(initialBounds, MGLCoordinateSpanMake(0, 30)); [tester.mapView setVisibleCoordinateBounds:offsetBounds animated:NO]; @@ -181,7 +181,7 @@ @"after panning 30° to the east, setting visible coordinate bounds back to %@ should not leave them at %@", MGLStringFromCoordinateBounds(initialBounds), MGLStringFromCoordinateBounds(tester.mapView.visibleCoordinateBounds)); - + // Inscribed shapes with rotation tester.mapView.direction = 45; // https://en.wikipedia.org/wiki/Boundary_Markers_of_the_Original_District_of_Columbia @@ -220,7 +220,7 @@ - (void)testSetCenterCancelsTransitions { XCTestExpectation *cameraIsInDCExpectation = [self expectationWithDescription:@"camera reset to DC"]; - + CLLocationCoordinate2D dc = CLLocationCoordinate2DMake(38.894368, -77.036487); CLLocationCoordinate2D dc_west = CLLocationCoordinate2DMake(38.894368, -77.076487); [tester.mapView setCenterCoordinate:dc animated:NO]; @@ -239,7 +239,7 @@ @"setting center coordinate should cancel transitions"); [cameraIsInDCExpectation fulfill]; }); - + [self waitForExpectationsWithTimeout:1.0 handler:nil]; } @@ -276,13 +276,13 @@ - (void)testRotateCounterclockwise { CLLocationDirection startAngle = tester.mapView.direction; - + XCTAssertNotEqual(startAngle, -45, @"start angle must not be destination angle"); - + [tester.mapView twoFingerRotateAtPoint:tester.mapView.center angle:-45]; - + XCTAssertGreaterThanOrEqual(fabs(startAngle - tester.mapView.direction), 20, @"rotating map should change angle"); @@ -419,20 +419,20 @@ - (void)testInsetMapView { [tester.viewController insetMapView]; [tester waitForAnimationsToFinish]; - + UIView *logoBug = (UIView *)[tester waitForViewWithAccessibilityLabel:@"Mapbox"]; UIView *attributionButton = (UIView *)[tester waitForViewWithAccessibilityLabel:@"About this map"]; - + CGRect mapViewFrame = [tester.mapView.superview convertRect:tester.mapView.frame toView:nil]; - + CGRect logoBugFrame = [logoBug.superview convertRect:logoBug.frame toView:nil]; XCTAssertTrue(CGRectIntersectsRect(logoBugFrame, mapViewFrame), @"logo bug should lie inside shrunken map view"); - + CGRect attributionButtonFrame = [attributionButton.superview convertRect:attributionButton.frame toView:nil]; XCTAssertTrue(CGRectIntersectsRect(attributionButtonFrame, mapViewFrame), @"attribution button should lie inside shrunken map view"); - + CGRect compassFrame = [tester.compass.superview convertRect:tester.compass.frame toView:nil]; XCTAssertTrue(CGRectIntersectsRect(compassFrame, mapViewFrame), @"compass should lie inside shrunken map view"); |