Skip to content

test(widgets): add JVM unit and composable tests for ScaleBar - #1003

Draft
dkhawk wants to merge 1 commit into
feature/robolectric-testsfrom
feature/robolectric-widgets-tests
Draft

dkhawk wants to merge 1 commit into
feature/robolectric-testsfrom
feature/robolectric-widgets-tests

Conversation

@dkhawk

@dkhawk dkhawk commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Description

Stacked PR on top of #1001 (feature/robolectric-tests).

Introduces JVM unit and Compose integration tests using Robolectric and the local shadow library for maps-compose-widgets, bringing module line coverage up from 0.00% to 67.12% (instruction coverage from 0.00% to 80.68%).

Summary of Changes

  • Added test dependencies (robolectric, mockk, truth, androidx.test.compose.ui, maps.robolectric.shadows) in maps-compose-widgets/build.gradle.kts.
  • Configured Robolectric Android resources and Java 21 test runner toolchain.
  • Added debug manifest with ComponentActivity for Robolectric Compose rule hosting.
  • Added ScaleBarTest.kt covering canvas distance calculation, unit conversions (ft, mi), ScaleBar composable rendering, and DisappearingScaleBar camera position animation/state changes.

cc @LoyalAbbas @kikoso

@github-actions

Copy link
Copy Markdown

Coverage (unit tests)

Compared against a24cc53 on feature/robolectric-tests (#1000).

Module Line % Change Branch % Change
maps-compose 36.56% 🔺 +36.56 10.32% 🔺 +10.32
maps-compose-utils 2.04% no change 0.49% no change
maps-compose-widgets 67.12% 🔺 +67.12 52.94% 🔺 +52.94
TOTAL 31.19% 🔺 +30.77 9.82% 🔺 +9.73

Line and branch coverage from unit test reports. History is recorded in coverage/history.csv after each merge to feature/robolectric-tests.

@dkhawk
dkhawk requested a review from kikoso September 15, 2026 21:59
@googlemaps-bot

Copy link
Copy Markdown
Contributor

Code Coverage

Overall Project 24.61%

There is no coverage information present for the Files changed

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