-
Notifications
You must be signed in to change notification settings - Fork 119
Fix Attach to roads flows after Plan Route refactor #5740
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c717196
Fix Attach to roads flows after Plan Route refactor
aleksandr-tata 7b33713
Fix Attach to roads during active navigation
aleksandr-tata 3b5cd01
Preserve source track identity in Attach to roads flow
aleksandr-tata 610fefd
Preserve source GPX path during active Follow Track
aleksandr-tata bd48146
Preserve source GPX path when entering Route Planning
aleksandr-tata 7a81ff1
Separate Attach apply from Plan Route navigation
aleksandr-tata ab662ff
Handle Attach apply failures without closing Plan Route
aleksandr-tata 2e7fb0d
Fix generic Plan Route navigation for unchanged tracks
aleksandr-tata 505a322
Fix adding POIs to pathless Attach tracks
aleksandr-tata 4cafd0c
Preserve source folder for pathless Attach tracks
aleksandr-tata 3c396bf
Remove obsolete route planning controller
aleksandr-tata faabbc2
Remove duplicate reorder segment command
aleksandr-tata b2fefbe
Fix single-point Plan Route navigation
aleksandr-tata ae2ddbf
Restore approximation before Plan Route navigation
aleksandr-tata b1d76da
Restore default profile fallback in Plan Route navigation
aleksandr-tata 90fcb4a
Fix navigation from empty Plan Route
aleksandr-tata 25affcb
Fix Follow Track Plan Route presentation race
aleksandr-tata dc34c40
Fix Edit Track and Attach intent handling
aleksandr-tata c22709f
Move approximation callback dispatch to data provider
aleksandr-tata 4a5530d
Deduplicate GPX test directory path
aleksandr-tata 9f1fb73
Fix navigation between unrouted Plan Route points
aleksandr-tata 0fd23e5
Fix Follow Track mode in Plan Route
aleksandr-tata File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
312 changes: 312 additions & 0 deletions
312
OsmAnd MapsTests/PlanRoute/OAPlanRouteEditingBridgeTest.mm
Large diffs are not rendered by default.
Oops, something went wrong.
71 changes: 71 additions & 0 deletions
71
OsmAnd MapsTests/PlanRoute/PlanRouteTrackSourceTests.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import XCTest | ||
|
|
||
| final class PlanRoutePresentationContextTests: XCTestCase { | ||
|
|
||
| func testFollowTrackEditPreservesFollowModeWithoutAttachBehavior() { | ||
| let context = PlanRoutePresentationContext.followTrack(attachToRoads: false) | ||
|
|
||
| XCTAssertTrue(context.followTrackMode) | ||
| XCTAssertFalse(context.showSnapWarning) | ||
| XCTAssertFalse(context.appliesApproximationToNavigation) | ||
| } | ||
|
|
||
| func testFollowTrackAttachEnablesWarningAndNavigationApply() { | ||
| let context = PlanRoutePresentationContext.followTrack(attachToRoads: true) | ||
|
|
||
| XCTAssertTrue(context.followTrackMode) | ||
| XCTAssertTrue(context.showSnapWarning) | ||
| XCTAssertTrue(context.appliesApproximationToNavigation) | ||
| } | ||
| } | ||
|
|
||
| final class PlanRouteTrackSourceTests: XCTestCase { | ||
|
|
||
| private let gpxDirectory = "/Documents/GPX" | ||
|
|
||
| func testPathlessGpxKeepsSourceFilePathSeparateFromEditableFilePath() { | ||
| let sourceFilePath = "\(gpxDirectory)/twisty-route.gpx" | ||
| let source = PlanRouteTrackSource(gpxFilePath: "", sourceFilePath: sourceFilePath) | ||
|
|
||
| XCTAssertNil(source.editableFilePath) | ||
| XCTAssertEqual(source.sourceFilePath, sourceFilePath) | ||
| } | ||
|
|
||
| func testPathlessGpxUsesSourceFilePathForWaypointEditing() { | ||
| let sourceFilePath = "\(gpxDirectory)/twisty-route.gpx" | ||
| let source = PlanRouteTrackSource(gpxFilePath: "", sourceFilePath: sourceFilePath) | ||
|
|
||
| XCTAssertEqual(source.waypointEditingFilePath, sourceFilePath) | ||
| } | ||
|
|
||
| func testPathlessGpxUsesSourceFolderForSaving() { | ||
| let sourceFilePath = "\(gpxDirectory)/import/twisty-route.gpx" | ||
| let source = PlanRouteTrackSource(gpxFilePath: "", sourceFilePath: sourceFilePath) | ||
|
|
||
| XCTAssertEqual(source.savingFolder(relativeTo: gpxDirectory), "import") | ||
| } | ||
|
|
||
| func testGpxInRootFolderHasNoSavingSubfolder() { | ||
| let sourceFilePath = "\(gpxDirectory)/twisty-route.gpx" | ||
| let source = PlanRouteTrackSource(gpxFilePath: sourceFilePath, sourceFilePath: nil) | ||
|
|
||
| XCTAssertNil(source.savingFolder(relativeTo: gpxDirectory)) | ||
| } | ||
|
|
||
| func testGpxFilePathIsUsedWhenExplicitSourceFilePathIsMissing() { | ||
| let sourceFilePath = "\(gpxDirectory)/twisty-route.gpx" | ||
| let source = PlanRouteTrackSource(gpxFilePath: sourceFilePath, sourceFilePath: nil) | ||
|
|
||
| XCTAssertEqual(source.editableFilePath, sourceFilePath) | ||
| XCTAssertEqual(source.sourceFilePath, sourceFilePath) | ||
| } | ||
|
|
||
| func testPathlessGpxWithoutSourceFilePathKeepsBothPathsEmpty() { | ||
| let source = PlanRouteTrackSource(gpxFilePath: "", sourceFilePath: nil) | ||
|
|
||
| XCTAssertNil(source.editableFilePath) | ||
| XCTAssertNil(source.sourceFilePath) | ||
| XCTAssertNil(source.waypointEditingFilePath) | ||
| XCTAssertNil(source.savingFolder(relativeTo: gpxDirectory)) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
private let gpxDirectory = "/Documents/GPX"