Skip to content

Add Compose UI characterisation tests with robot/scenario pattern#220

Merged
timusus merged 1 commit intomainfrom
compose-characterisation-tests
Mar 28, 2026
Merged

Add Compose UI characterisation tests with robot/scenario pattern#220
timusus merged 1 commit intomainfrom
compose-characterisation-tests

Conversation

@timusus
Copy link
Copy Markdown
Owner

@timusus timusus commented Mar 28, 2026

Summary

  • Robolectric-based Compose tests for SongList (19 tests) and GenreList (17 tests) that verify all observable UI behaviour
  • Screen robots encapsulate selectors so implementation changes update one place
  • Scenario factories for readable ViewState construction
  • Removes 3 redundant mock-verify-only ViewModel tests now covered by UI tests

Test plan

  • All 36 characterisation tests pass
  • Existing SongListViewModelTest passes (12 remaining tests)
  • Existing Paparazzi snapshot tests unaffected

Robolectric-based Compose tests for SongList and GenreList that verify
all observable UI behaviour, enabling safe rearchitecting of the
underlying Compose/ViewModel code.

- Add Robolectric 4.14.1 and Compose UI test dependencies
- Add robolectric.properties (sdk=34, graphics=NATIVE, plain Application)
- Add SongListTest (19 tests) and GenreListTest (17 tests)
- Add screen robots (SongListRobot, GenreListRobot) encapsulating selectors
- Add scenario factories for readable ViewState construction
- Add createGenre() and createPlaylist() test model factories
- Remove 3 redundant mock-verify-only tests from SongListViewModelTest
  (covered by UI characterisation tests)
@timusus timusus merged commit d563429 into main Mar 28, 2026
1 check failed
@timusus timusus deleted the compose-characterisation-tests branch March 28, 2026 06:41
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.

1 participant