Add Paparazzi snapshot testing pipeline#36
Merged
Conversation
Apply the Paparazzi plugin (2.0.0-alpha02, the line that supports this repo's Kotlin 2.2 / AGP 8.13 toolchain) and add snapshot tests for the AI compose components. PaparazziTest is the shared base: it renders inside MaterialTheme and Surface (the module has no ChatTheme), enables LocalInspectionMode, and provides a no-op ActivityResultRegistryOwner so the composer's photo-picker launcher renders without a host activity. Tests cover AITypingIndicator, ChatComposer, and SpeechToTextButton, producing 9 golden images. Preview content for each state is extracted into shared internal composables that both the @Preview functions and the snapshot tests call, so they cannot drift apart. Snapshot verification runs on CI through the unit test job, which now runs verifyPaparazziDebug (a superset that also runs the regular unit tests).
… frame StreamingText revealed its text through a LaunchedEffect, so the first composition showed empty text before the effect ran. When animate is false, initialize the displayed text to the full text so it appears immediately, matching the documented behavior and letting it render in a single Paparazzi frame. Add the StreamingText snapshot test and its shared preview content function.
Contributor
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
Contributor
SDK Size Comparison 📏
|
gpunto
approved these changes
Jun 16, 2026
gpunto
left a comment
Contributor
There was a problem hiding this comment.
Looks good, I just left a suggestion to align with the other repos
Align with the other Stream repos: the convention plugin registers a testCoverage task that runs verifyPaparazziDebug for modules with the Paparazzi plugin. Opt the module into coverage.includedModules and apply the Paparazzi plugin first so the convention detects it, then run testCoverage on CI.
|
🚀 Available in v0.3.0 |
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.
Goal
The
stream-chat-android-ai-composemodule had no test source set and no snapshot coverage. This adds a Paparazzi snapshot pipeline so UI changes to the AI components are caught on every PR. It also lands before the component factory work (AND-1233), so that change can show a clean visual diff against this baseline. Linear: AND-1234.Implementation
2.0.0-alpha02. The stable line does not support this repo's Kotlin 2.2 / AGP 8.13 toolchain, and the newer alpha needs Gradle 9, soalpha02is the only line that works here.PaparazziTestis the shared base. It renders insideMaterialThemeandSurface(the module has noChatTheme), enablesLocalInspectionMode, and provides a no-opActivityResultRegistryOwnerso the composer's photo picker renders without a host activity.ChatComposer,StreamingText,AITypingIndicator,SpeechToTextButton(10 golden images undersrc/test/snapshots/images).internalcomposable used by both the@Previewand the snapshot test, so previews and snapshots cannot drift apart. This matches the main SDK convention.testCoveragetask, which runsverifyPaparazziDebugfor modules with the Paparazzi plugin (and the regular unit tests). The Paparazzi plugin is applied before the convention plugin so it is detected.StreamingText: whenanimateis false, initialize the displayed text to the full text so the first frame shows it. The text was revealed through an effect that does not settle in a single frame. This also removes an empty-frame flash for static messages. The animated path is unchanged.Testing
Automated:
./gradlew testCoverageruns the unit tests and verifies all snapshots../gradlew recordPaparazziDebugregenerates the goldens.Manual steps in the sample app:
Notes for the reviewer:
2.0.0-alpha02is a pre-release, used because it is the only line compatible with this toolchain.Checklist