Repository navigation
Conversation
…s Testing Toolkit
* test(widgets): add JVM unit and composable tests for ScaleBar * test(widgets): address review feedback in ScaleBarTest - Assert calculateDistance against known ground-truth values (mocked equatorial span = 98m, plus Mercator zoom 12 checks at 0 deg and 60 deg latitude) instead of repeating the implementation formula. - Remove unused sphericalDistance import from ScaleBarTest. - Add displayed text assertions in ScaleBar test and mainClock-driven show/hide/re-show/hide assertions in DisappearingScaleBar test.
- Delete maps-compose-widgets/src/debug/AndroidManifest.xml and use testImplementation(libs.androidx.test.compose.ui.manifest). - Remove unused androidx.test.core and kotlinx-coroutines-test dependencies from maps-compose-widgets/build.gradle.kts. - Document null-projection fallback behavior in ScaleBarTest.
…aleBar Adds ScaleBarAdversarialTest covering real failure modes beyond basic smoke checks: - Antimeridian crossing (+/-180 deg) short-span measurement - Strict-mock odd default width (65.dp) exact pixel span and 3x density scaling - Zero and sub-pixel width handling, continental zoom overflow safety, near-polar latitude, and zoom monotonicity - Live GoogleMap + ScaleBar integration verifying reactive updates on zoom, latitude pan, and null-to-bound projection transitions - measureAtCenter = true vs false divergence across a viewport at low zoom - DisappearingScaleBar rapid camera move timer cancellation/reset, mid-exit-fade interruption recovery, 0 ms duration, and equal-position idempotency
dkhawk
marked this pull request as ready for review
December 2, 2026 15:33
Coverage (unit tests)Compared against
Line and branch coverage from unit test reports. History is recorded on the |
Contributor
Coverage (instrumentation tests)
|
This branch has not been deployed
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.
Summary
Follow-up to #1001 adding adversarial and live
GoogleMap-bound Robolectric tests inScaleBarAdversarialTestfor:maps-compose-widgets.What this tests
calculateDistance):±180°) crossing measures the short span (197 m) instead of wrapping the globe.65.dp→[468, 533], catching off-by-1 pixel truncation) and3xdisplay density scaling.0.dp) and sub-pixel (1.dpat0.5xdensity) widths return0.zoom 2f, noIntoverflow), near-polar latitude (85°), and monotonic zoom ordering (zoom 2 > 12 > 18 > 0).GoogleMap+ScaleBarintegration:km/milabels at zoom 12, reactivekm/mi→m/fttransition at zoom 17, and ~50% distance decrease panning to60°latitude.projectiontransition (null→ boundGoogleMap) replacing"0 ft"/"0 m"fallback without mutatingcameraState.position.measureAtCenter = truevsfalsedivergence across a600.dpviewport at zoom 3 (centerKm > topEdgeKm > 0).DisappearingScaleBartiming & concurrency:LaunchedEffectand extend visibility past the original deadline.visibilityDurationMillis = 0safety and equalCameraPositionre-assignment not spuriously re-showing.cc @kikoso @LoyalAbbas