Skip to content

Conversation

@ArtemStepuk
Copy link
Contributor

@ArtemStepuk ArtemStepuk commented Oct 21, 2025

Description

Merge request contains only integration tests.

Covers:

  • Route refresh with default profile
  • Route refresh with custom profile
  • Reroute with default profile
  • Reroute with custom profile
  • Reroute with custom query items

@ArtemStepuk ArtemStepuk changed the title As/core integration tests [Core] Route refresh integration test Oct 21, 2025
@ArtemStepuk ArtemStepuk marked this pull request as ready for review October 31, 2025 11:36
@ArtemStepuk ArtemStepuk requested a review from a team as a code owner October 31, 2025 11:36
]
),
.testTarget(
name: "MapboxCoreNavigationIntegrationTests",
Copy link
Contributor

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

Comment on lines +266 to +267
let mappedUrlItem = queryItems!.first(where: { $0 == .customItem })!
self.customParameters = [mappedUrlItem]
Copy link
Contributor

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.

Suggested change
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 {
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)

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

Successfully merging this pull request may close these issues.

2 participants