Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange things in NavigationViewControllerTests that seem not to be testing anything. #46

Open
michaelkirk opened this issue May 24, 2024 · 0 comments

Comments

@michaelkirk
Copy link
Collaborator

There are a few tests that seem to be in pursuit of making sure the stylemanager switches style when appropriate (and only when appropriate).

I noted this while working on some adjacent code, and it was requested I make an issue with my findings.

Weird things:

  1. There's a test about tunnel travel, but it doesn't look like the route goes through any tunnel.

  2. strange movement simulation.
    I'm assuming the following code was intended to simulate travel by updating the location along the route:

routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation])
routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation])
routeController.locationManager(routeController.locationManager, didUpdateLocations: [someLocation])

But why is it using the same location all three times? I'd expect each call to be a further point along the route.

  1. There are several tests that check that the style has not changed after certain actions, but the actions seems incoherent (see point 2.), and there is no test to checks the positive condition that the style has ever changed, so I'm not confident that any of the expected code is being tested.

  2. Some variables have misleading names - they seem to have nothing to do with actual intersections along the route. There's no taylorStreet, turkStreet, or fultonStreet at these points. I wonder if the underlying route changed at some point? It's a minor thing but it added to my confusion.

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!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant