<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/beyond-semantics-how-to-test-internal-compose-state-with-snapshotflow-jdhoj0koc" -->

---
title: Beyond Semantics: How to Test Internal Compose State...
description: snapshotFlow is a Jetpack Compose API that converts Compose State into a cold Kotlin Flow, enabling reactive observation of state changes in coroutines. This...
canonical: https://daily.dev/posts/beyond-semantics-how-to-test-internal-compose-state-with-snapshotflow-jdhoj0koc
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Beyond Semantics: How to Test Internal Compose State with snapshotFlow | daily.dev
og:description: snapshotFlow is a Jetpack Compose API that converts Compose State into a cold Kotlin Flow, enabling reactive observation of state changes in coroutines. This...
og:url: https://daily.dev/posts/beyond-semantics-how-to-test-internal-compose-state-with-snapshotflow-jdhoj0koc
og:image: https://api.daily.dev/og/posts/jdHoj0kOc.png
og:image:alt: Beyond Semantics: How to Test Internal Compose State with snapshotFlow
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Beyond Semantics: How to Test Internal Compose State with snapshotFlow

**[ProAndroidDev](https://daily.dev/sources/pand)** · 5 min read · 0 upvotes · 0 comments

## Summary

snapshotFlow is a Jetpack Compose API that converts Compose State into a cold Kotlin Flow, enabling reactive observation of state changes in coroutines. This makes it a powerful tool for UI testing scenarios where the Semantics Tree is insufficient — such as tracking LazyListState scroll offsets, Pager internal state, or Animatable values. Instead of relying on Thread.sleep() or polling loops that cause flaky tests, snapshotFlow lets tests wait precisely until a state condition is met before asserting. A practical test example demonstrates using snapshotFlow inside composeTestRule.waitUntil() to synchronize test execution with scroll state, eliminating race conditions and improving test reliability.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://proandroiddev.com/beyond-semantics-how-to-test-internal-compose-state-with-snapshotflow-84580624fc20>

## Similar posts on daily.dev

- [Reducing Unnecessary Recompositions: 3 Practical Optimization Techniques for Jetpack Compose](https://daily.dev/posts/reducing-unnecessary-recompositions-3-practical-optimization-techniques-for-jetpack-compose-vej7oyanp) · droidcon · 0 upvotes · 0 comments
- [Kotlin Flows in Android: A Clear Mental Model](https://daily.dev/posts/kotlin-flows-in-android-a-clear-mental-model-ln8rffwwm) · Medium · 0 upvotes · 0 comments
- [Getting Started with Slack Circuit Framework for Jetpack Compose](https://daily.dev/posts/getting-started-with-slack-circuit-framework-for-jetpack-compose-ijb52owpv) · ProAndroidDev · 0 upvotes · 0 comments
- [Process Death and SavedStateHandle in Android](https://daily.dev/posts/process-death-and-savedstatehandle-in-android-82qtjktll) · Atomic Spin · 0 upvotes · 0 comments

---

Tags: [#kotlin](https://daily.dev/tags/kotlin), [#jetpack-compose](https://daily.dev/tags/jetpack-compose)

[View this post on daily.dev](https://daily.dev/posts/beyond-semantics-how-to-test-internal-compose-state-with-snapshotflow-jdhoj0koc)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Beyond Semantics: How to Test Internal Compose State with snapshotFlow","url":"https://daily.dev/posts/beyond-semantics-how-to-test-internal-compose-state-with-snapshotflow-jdhoj0koc","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/beyond-semantics-how-to-test-internal-compose-state-with-snapshotflow-jdhoj0koc"},"datePublished":"2026-07-31T08:25:53.791Z","dateModified":"2026-07-31T09:23:13.931Z","description":"snapshotFlow is a Jetpack Compose API that converts Compose State into a cold Kotlin Flow, enabling reactive observation of state changes in coroutines. This...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8129a192db5cc9e6c660cf9dc2c53520?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8129a192db5cc9e6c660cf9dc2c53520?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"ProAndroidDev","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ProAndroidDev","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/656c1eb1f1ef4f91936e86fc16545114","url":"https://daily.dev/sources/pand"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/beyond-semantics-how-to-test-internal-compose-state-with-snapshotflow-jdhoj0koc","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"kotlin,jetpack-compose","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ProAndroidDev","item":"https://daily.dev/sources/pand"},{"@type":"ListItem","position":3,"name":"Beyond Semantics: How to Test Internal Compose State with snapshotFlow"}]}
```

