-
Notifications
You must be signed in to change notification settings - Fork 21
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
Update tests to remove reliance on UserDefaults #156
Merged
Merged
Conversation
This file contains 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
- Remove all usages of UserDefaults from MapboxSearch and MapboxSearchUI - Add LocalhostMockServiceProvider for integration tests to provide a mocked customBaseURL - Add FeedbackIntegrationTestCase back to UI test suite - Split MockServerTestCase into UI and Integration variants because it had a namespace collision - Utilize customBaseURL for ServiceProvider and LocalhostMockServiceProvider - Stop reading from NSUserDefaults - Update integration tests to use LocalhostMockServiceProvider
…e-userdefaults-from-tests Conflicts: Tests/MapboxSearchIntegrationTests/CategorySearchEngineIntegrationTests.swift Tests/MapboxSearchIntegrationTests/SearchEngineIntegrationTests.swift
…istinguishing enum cases
…s in MockWebServer - This moves unit and UI-tested traffic into mocked traffic
- Add more mock data for uncovered cases - Rename SearchEngine.reverseGeocoding to SearchEngine.reverse - Fix SearchEngineIntegrationTests to align queries with mock data
azarovalex
reviewed
Feb 7, 2024
azarovalex
reviewed
Feb 7, 2024
azarovalex
reviewed
Feb 7, 2024
Tests/MapboxSearchIntegrationTests/SearchEngineGeocodingIntegrationTests.swift
Outdated
Show resolved
Hide resolved
azarovalex
previously approved these changes
Feb 7, 2024
…e-userdefaults-from-tests Conflicts: CHANGELOG.md
azarovalex
approved these changes
Feb 8, 2024
aokj4ck
added a commit
that referenced
this pull request
Apr 5, 2024
- Remove all usages of UserDefaults from MapboxSearch and MapboxSearchUI - Replaces this with plain dependency injection - Add LocalhostMockServiceProvider for integration tests to provide a mocked customBaseURL - Add FeedbackIntegrationTestCase back to UI test suite - Split MockServerTestCase into UI and Integration variants because it had a namespace collision - Utilize customBaseURL for ServiceProvider and LocalhostMockServiceProvider - Stop reading from "MapboxAPIBaseURL" from NSUserDefaults in `ServiceProvider.createEngine`. - Providing a value in Info.plist is still supported. - Update integration tests to use LocalhostMockServiceProvider - This fixes a bug in the Demo app where you building and running the app or tests could use the wrong baseApiURL based on the current value in user defaults. - Update and correct tests for iOS 17 using all mocked data for unit and UI tests. - Rename `SearchEngine.reverseGeocoding` function to `SearchEngine.reverse`. - [x] Update `CHANGELOG` | Before | After | | -- | -- | | <img width="355" alt="Screenshot 2024-02-06 at 17 47 49" src="https://github.com/mapbox/mapbox-search-ios/assets/384288/f615ad45-efeb-4687-9373-f89d0037c982"> | <img width="356" alt="Screenshot 2024-02-06 at 17 28 38" src="https://github.com/mapbox/mapbox-search-ios/assets/384288/801d518e-c8c2-4403-93f8-1ef2336338c7"> | Conflicts: CHANGELOG.md MapboxSearch.xcodeproj/project.pbxproj Sources/MapboxSearch/PublicAPI/ServiceProvider.swift Tests/MapboxSearchIntegrationTests/CategorySearchEngineIntegrationTests.swift Tests/MapboxSearchIntegrationTests/SearchEngineIntegrationTests.swift
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
ServiceProvider.createEngine
.SearchEngine.reverseGeocoding
function toSearchEngine.reverse
.Checklist
CHANGELOG
Screenshots