From ebd89375ea07cc82ece9d05dd50a77f8103bde9a Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 24 May 2024 09:49:33 -0700 Subject: [PATCH] Revert "add notes about broken/useless tests" This reverts commit 7d907bfebb2a46f24a51de40e211cbb2ac018755. --- .../Sources/Tests/NavigationViewControllerTests.swift | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/MapboxNavigationTests/Sources/Tests/NavigationViewControllerTests.swift b/MapboxNavigationTests/Sources/Tests/NavigationViewControllerTests.swift index 496eaa42..273c9e90 100644 --- a/MapboxNavigationTests/Sources/Tests/NavigationViewControllerTests.swift +++ b/MapboxNavigationTests/Sources/Tests/NavigationViewControllerTests.swift @@ -28,7 +28,6 @@ class NavigationViewControllerTests: XCTestCase { let firstLocation = location(at: firstCoord) var poi = [CLLocation]() - // REVIEW: What are these variable names? They seem completely unrelated to the intersections in the route. let taylorStreetIntersection = routeController.routeProgress.route.legs.first!.steps.first!.intersections!.first! let turkStreetIntersection = routeController.routeProgress.route.legs.first!.steps[3].intersections!.first! let fultonStreetIntersection = routeController.routeProgress.route.legs.first!.steps[5].intersections!.first! @@ -89,7 +88,6 @@ class NavigationViewControllerTests: XCTestCase { XCTAssertFalse(wayNameView.isHidden, "WayNameView should be visible.") } - // TODO: This test doesn't seem to be testing anything. Adding a test where `updatedStyleNumberOfTimes = 1` might be illuminating func testNavigationShouldNotCallStyleManagerDidRefreshAppearanceMoreThanOnceWithOneStyle() { let navigationViewController = NavigationViewController(for: initialRoute, dayStyle: DayStyle(demoStyle: ()), @@ -100,7 +98,6 @@ class NavigationViewControllerTests: XCTestCase { let someLocation = self.dependencies.poi.first! - // TODO: Why are we updating with the same location 3 times? routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation]) routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation]) routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation]) @@ -109,16 +106,16 @@ class NavigationViewControllerTests: XCTestCase { self.updatedStyleNumberOfTimes = 0 } - // TODO: This test doesn't seem to be testing anything. The route does not actually go through a tunnel. // If tunnel flags are enabled and we need to switch styles, we should not force refresh the map style because we have only 1 style. func testNavigationShouldNotCallStyleManagerDidRefreshAppearanceWhenOnlyOneStyle() { + // REVIEW: is this right? Does it make sense that there would ever be *only* a night style? + // let navigationViewController = NavigationViewController(for: initialRoute, directions: fakeDirections, styles: [NightStyle()], voiceController: FakeVoiceController()) let navigationViewController = NavigationViewController(for: initialRoute, dayStyle: DayStyle(demoStyle: ()), directions: fakeDirections, voiceController: FakeVoiceController()) let routeController = navigationViewController.routeController! navigationViewController.styleManager.delegate = self let someLocation = self.dependencies.poi.first! - // TODO: Why are we updating with the same location 3 times? routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation]) routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation]) routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation]) @@ -127,8 +124,6 @@ class NavigationViewControllerTests: XCTestCase { self.updatedStyleNumberOfTimes = 0 } - // TODO: This test doesn't seem to be testing anything. The route does not actually go through a tunnel or do anything - // that would cause the style to change. Maybe having a positive test where the style *does* change exactly once would be helpful func testNavigationShouldNotCallStyleManagerDidRefreshAppearanceMoreThanOnceWithTwoStyles() { let navigationViewController = NavigationViewController(for: initialRoute, dayStyle: DayStyle(demoStyle: ()), nightStyle: NightStyle(demoStyle: ()), directions: fakeDirections, voiceController: FakeVoiceController()) let routeController = navigationViewController.routeController! @@ -136,7 +131,6 @@ class NavigationViewControllerTests: XCTestCase { let someLocation = self.dependencies.poi.first! - // TODO: Why are we updating with the same location 3 times? routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation]) routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation]) routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation])