- 
                Notifications
    
You must be signed in to change notification settings  - Fork 326
 
[Core] Route refresh integration test #4802
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
base: lts/v2
Are you sure you want to change the base?
Conversation
| ] | ||
| ), | ||
| .testTarget( | ||
| name: "MapboxCoreNavigationIntegrationTests", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When added as a test target, these tests will be run as a part of required job, as a MapboxNavigation-Package step
| let mappedUrlItem = queryItems!.first(where: { $0 == .customItem })! | ||
| self.customParameters = [mappedUrlItem] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid using unnecessary ! to avoid crashes, even in tests.
| let mappedUrlItem = queryItems!.first(where: { $0 == .customItem })! | |
| self.customParameters = [mappedUrlItem] | |
| let mappedUrlItem = queryItems?.first(where: { $0 == .customItem }) | |
| self.customParameters = mappedUrlItem.map { [$0] } ?? [] | 
| static let customItem: URLQueryItem = .init(name: "foo", value: "bar") | ||
| } | ||
| 
               | 
          ||
| fileprivate final class CustomRouteOptions: NavigationRouteOptions { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a class CustomRouteOptions in the TestHelper. Is it possible to reuse it there somehow?
| } | ||
| 
               | 
          ||
| func testRouteRefreshWithCustomDrivingTrafficProfile() { | ||
| simulateAndTestOnRoute(with: .custom, shouldRefresh: true) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please rename .custom to .customDrivingTraffic so it's clear we don't refresh any custom profile, only the custom driving-traffic?
| } | ||
| 
               | 
          ||
| func testRouteRefreshWithWalkingProfile() { | ||
| simulateAndTestOnRoute(with: .walking, shouldRefresh: false) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please also add a separate test for
 simulateAndTestOnRoute(with: .automobile, shouldRefresh: false)
Description
Merge request contains only integration tests.
Covers: