diff --git a/android/player/src/test/java/com/intuit/player/android/utils/updates.kt b/android/player/src/test/java/com/intuit/player/android/utils/updates.kt index 0c8c9538c..f628b6fd6 100644 --- a/android/player/src/test/java/com/intuit/player/android/utils/updates.kt +++ b/android/player/src/test/java/com/intuit/player/android/utils/updates.kt @@ -29,12 +29,12 @@ internal fun AndroidPlayer.updates(flow: JsonElement, take: Int = 1) = updates(f internal fun AndroidPlayer.updates(flow: String, take: Int = 1): Flow = callbackFlow { var count = 0 onUpdate { asset, _ -> - offer(Update.Asset(asset, count)) + trySend(Update.Asset(asset, count)).isSuccess if (++count >= take) close() } hooks.state.tap { state -> - offer(Update.State(state ?: ErrorState.from("state was null"))) + trySend(Update.State(state ?: ErrorState.from("state was null"))).isSuccess } start(flow).onComplete {