Skip to content

test(utils): add JVM unit and composable integration tests for Clustering and WmsTileOverlay - #1004

Draft
dkhawk wants to merge 3 commits into
feature/robolectric-widgets-testsfrom
feature/robolectric-utils-tests
Draft

dkhawk wants to merge 3 commits into
feature/robolectric-widgets-testsfrom
feature/robolectric-utils-tests

Conversation

@dkhawk

@dkhawk dkhawk commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Description

Stacked PR on top of #1003 (feature/robolectric-widgets-tests), which stacks on #1001 (feature/robolectric-tests).

Introduces comprehensive JVM unit and Compose integration tests for maps-compose-utils using Robolectric and the local shadow library, raising module line coverage from 2.04% to 69.19% (instruction coverage from 0.78% to 64.11%). Across all three published library modules (maps-compose, maps-compose-widgets, maps-compose-utils), total JVM line coverage reaches 44.95%.

Summary of Changes

  • Added test dependencies (robolectric, truth, mockk, androidx.test.compose.ui, maps.robolectric.shadows) to maps-compose-utils/build.gradle.kts.
  • Configured Robolectric Android resource processing and Java 21 test runner toolchain.
  • Added debug manifest with ComponentActivity for Robolectric Compose rule hosting.
  • Added WmsTileOverlayTest.kt verifying WmsTileOverlay composable rendering, tile overlay attributes (transparency, fade-in, visibility, z-index), and tile cache clearing.
  • Expanded WmsUrlTileProviderTest.kt covering valid URL formatting and malformed URL handling.
  • Added ClusteringTest.kt covering:
    • ClusteringMarkerProperties composition local propagation and mutation.
    • Clustering default renderer marker placement and manager callbacks.
    • Custom Compose UI content rendering (clusterContent, clusterItemContent, clusterItemDecoration).
    • Dynamic item updates (clearing, adding, re-clustering on state change).
    • rememberClusterManager and rememberClusterRenderer lifecycle initialization.

cc @LoyalAbbas @kikoso

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

googlemaps-bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Overall Project 24.61%

There is no coverage information present for the Files changed

@github-actions

Copy link
Copy Markdown

Coverage (unit tests)

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

Module Line % Change Branch % Change
maps-compose 36.56% 🔺 +36.56 10.32% 🔺 +10.32
maps-compose-utils 69.19% 🔺 +67.15 24.27% 🔺 +23.78
maps-compose-widgets 67.12% 🔺 +67.12 52.94% 🔺 +52.94
TOTAL 44.95% 🔺 +44.53 14.11% 🔺 +14.02

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

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