test: add comprehensive test suite for places-compose reaching 93.8% coverage - #116
Open
dkhawk wants to merge 1 commit into
Open
test: add comprehensive test suite for places-compose reaching 93.8% coverage#116dkhawk wants to merge 1 commit into
dkhawk wants to merge 1 commit into
Conversation
Contributor
Code Coverage
|
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
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
This PR establishes a comprehensive unit and Compose UI test suite for the
:places-composelibrary, raising project test coverage from 6.4% to 93.8% before any dependency or demo app changes.Additions:
UnitsTest.kt: TestsMetersvalue class arithmetic, comparison operators, and extensions (.meters,.m,.km,.feet,.miles,.toFeet,.toMeters,.toKilometers,.toMiles), along withImperialUnitsConvertervsMetricUnitsConverterthreshold formatting. (90.0% coverage)AddressMapperTest.kt: TestsAddressComponentMultiMapmulti-type indexing across allAddressComponentTypeenum variants,longNameandshortNamestring aggregations, and address conversions. (100.0% coverage)PlaceMapperTest.kt: Tests converting Places SDKAddressComponentlists to domainAddressmodels. (100.0% coverage)AutocompleteMapperTest.kt: Tests mappingAutocompletePredictiontoAutocompletePlaceusing MockK. (100.0% coverage)AutocompleteRepositoryTest.kt: Coroutine unit tests verifying PlacesClient delegation. (100.0% coverage)ModelsTest.kt: TestsAutocompletePlaceattributes,AreaandLandmarkspatial relationship string resolution, and distance calculations. (73.7% coverage)AddressDtoTest.kt: Comprehensive unit tests covering reverse geocoding DTO models and Gson serialization. (100.0% coverage)PlacesAutocompleteTextFieldTest.kt: Robolectric Compose UI test suite covering search field rendering, placeholder, keyboard input, prediction list display, place selection, clear button, back navigation button,@Previewcomposables, dark theme, and expanded states. (94.1% coverage)Test Harness Configurations:
PublishingConventionPlugin.ktJacoco configuration withisIncludeNoLocationClasses = trueto capture Robolectric classloader execution.places-compose/build.gradle.ktstestOptions { unitTests { isReturnDefaultValues = true; isIncludeAndroidResources = true } }and addedmockktest dependency.places-compose/src/debug/AndroidManifest.xmlwithComponentActivityandrobolectric.propertieswithsdk=34.Part of a stacked PR sequence:
ci/workflow-security-hardening)