From 9ebef8a06630829bffc11079b2b390d58c9ed80f Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 18 Feb 2019 17:34:33 -0800 Subject: [ios] Reset access token state after running tests --- platform/darwin/test/MGLAttributionInfoTests.m | 10 +++++++++- platform/darwin/test/MGLMapViewTests.m | 1 + platform/ios/Integration Tests/MGLMapViewIntegrationTest.m | 1 + platform/ios/test/MGLMapViewLayoutTests.m | 1 + platform/ios/test/MGLMapViewScaleBarTests.m | 1 + 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/platform/darwin/test/MGLAttributionInfoTests.m b/platform/darwin/test/MGLAttributionInfoTests.m index 29d5024bd3..48779f3407 100644 --- a/platform/darwin/test/MGLAttributionInfoTests.m +++ b/platform/darwin/test/MGLAttributionInfoTests.m @@ -9,6 +9,14 @@ @implementation MGLAttributionInfoTests +- (void)setUp { + [MGLAccountManager setAccessToken:@"pk.feedcafedeadbeefbadebede"]; +} + +- (void)tearDown { + [MGLAccountManager setAccessToken:nil]; +} + - (void)testParsing { static NSString * const htmlStrings[] = { @"© Mapbox " @@ -50,7 +58,7 @@ XCTAssertEqualObjects([infos[3] feedbackURLAtCenterCoordinate:mapbox zoomLevel:14], [NSURL URLWithString:@"https://apps.mapbox.com/feedback/?referrer=com.mapbox.Mapbox#/77.63680/12.98108/14.00/0.0/0"]); XCTAssertEqualObjects([infos[3] feedbackURLForStyleURL:styleURL atCenterCoordinate:mapbox zoomLevel:3.14159 direction:90.9 pitch:12.5], - [NSURL URLWithString:@"https://apps.mapbox.com/feedback/?referrer=com.mapbox.Mapbox&owner=mapbox&id=satellite-streets-v99&access_token&map_sdk_version=1.0.0#/77.63680/12.98108/3.14/90.9/13"]); + [NSURL URLWithString:@"https://apps.mapbox.com/feedback/?referrer=com.mapbox.Mapbox&owner=mapbox&id=satellite-streets-v99&access_token=pk.feedcafedeadbeefbadebede&map_sdk_version=1.0.0#/77.63680/12.98108/3.14/90.9/13"]); } - (void)testStyle { diff --git a/platform/darwin/test/MGLMapViewTests.m b/platform/darwin/test/MGLMapViewTests.m index 6ac8e1fe81..eb40ff724a 100644 --- a/platform/darwin/test/MGLMapViewTests.m +++ b/platform/darwin/test/MGLMapViewTests.m @@ -36,6 +36,7 @@ static MGLMapView *mapView; + (void)tearDown { mapView = nil; + [MGLAccountManager setAccessToken:nil]; [super tearDown]; } diff --git a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m index 77e678d3ef..de47ac3965 100644 --- a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m +++ b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m @@ -57,6 +57,7 @@ self.renderFinishedExpectation = nil; self.mapView = nil; self.style = nil; + [MGLAccountManager setAccessToken:nil]; [super tearDown]; } diff --git a/platform/ios/test/MGLMapViewLayoutTests.m b/platform/ios/test/MGLMapViewLayoutTests.m index dfae346289..48e9bedc4f 100644 --- a/platform/ios/test/MGLMapViewLayoutTests.m +++ b/platform/ios/test/MGLMapViewLayoutTests.m @@ -58,6 +58,7 @@ - (void)tearDown { self.styleLoadingExpectation = nil; self.mapView = nil; + [MGLAccountManager setAccessToken:nil]; [super tearDown]; } diff --git a/platform/ios/test/MGLMapViewScaleBarTests.m b/platform/ios/test/MGLMapViewScaleBarTests.m index 11d1187263..966d9c6c54 100644 --- a/platform/ios/test/MGLMapViewScaleBarTests.m +++ b/platform/ios/test/MGLMapViewScaleBarTests.m @@ -19,6 +19,7 @@ - (void)tearDown { self.mapView = nil; + [MGLAccountManager setAccessToken:nil]; [super tearDown]; } -- cgit v1.2.1