Skip to content

Commit

Permalink
Revert "add notes about broken/useless tests"
Browse files Browse the repository at this point in the history
This reverts commit 7d907bf.
  • Loading branch information
michaelkirk committed May 24, 2024
1 parent 708832e commit ebd8937
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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: ()),
Expand All @@ -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])
Expand All @@ -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])
Expand All @@ -127,16 +124,13 @@ 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!
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])
Expand Down

0 comments on commit ebd8937

Please sign in to comment.