Skip to content

Update dependency app.cash.molecule:molecule-runtime to v1 #925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package io.element.android.appnav

import app.cash.molecule.RecompositionClock
import app.cash.molecule.RecompositionMode
import app.cash.molecule.moleculeFlow
import app.cash.turbine.test
import com.google.common.truth.Truth.assertThat
Expand All @@ -38,7 +38,7 @@ class RootPresenterTest {
@Test
fun `present - initial state`() = runTest {
val presenter = createPresenter()
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
Expand All @@ -54,7 +54,7 @@ class RootPresenterTest {
showError("Bad news", "Something bad happened")
}
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package io.element.android.appnav.loggedin

import app.cash.molecule.RecompositionClock
import app.cash.molecule.RecompositionMode
import app.cash.molecule.moleculeFlow
import app.cash.turbine.test
import com.google.common.truth.Truth.assertThat
Expand All @@ -34,7 +34,7 @@ class LoggedInPresenterTest {
@Test
fun `present - initial state`() = runTest {
val presenter = createPresenter()
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package io.element.android.features.analytics.impl

import app.cash.molecule.RecompositionClock
import app.cash.molecule.RecompositionMode
import app.cash.molecule.moleculeFlow
import app.cash.turbine.test
import com.google.common.truth.Truth.assertThat
Expand All @@ -35,7 +35,7 @@ class AnalyticsOptInPresenterTest {
aBuildMeta(),
analyticsService
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand All @@ -53,7 +53,7 @@ class AnalyticsOptInPresenterTest {
aBuildMeta(),
analyticsService
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package io.element.android.features.analytics.impl.preferences

import app.cash.molecule.RecompositionClock
import app.cash.molecule.RecompositionMode
import app.cash.molecule.moleculeFlow
import app.cash.turbine.test
import com.google.common.truth.Truth.assertThat
Expand All @@ -33,7 +33,7 @@ class AnalyticsPreferencesPresenterTest {
FakeAnalyticsService(isEnabled = true, didAskUserConsent = true),
aBuildMeta()
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
Expand All @@ -48,7 +48,7 @@ class AnalyticsPreferencesPresenterTest {
FakeAnalyticsService(isEnabled = false, didAskUserConsent = false),
aBuildMeta()
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand All @@ -62,7 +62,7 @@ class AnalyticsPreferencesPresenterTest {
FakeAnalyticsService(isEnabled = true, didAskUserConsent = true),
aBuildMeta()
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package io.element.android.features.createroom.impl.addpeople

import app.cash.molecule.RecompositionClock
import app.cash.molecule.RecompositionMode
import app.cash.molecule.moleculeFlow
import app.cash.turbine.test
import com.google.common.truth.Truth.assertThat
Expand All @@ -43,7 +43,7 @@ class AddPeoplePresenterTests {

@Test
fun `present - initial state`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
// TODO This doesn't actually test anything...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package io.element.android.features.createroom.impl.configureroom

import android.net.Uri
import app.cash.molecule.RecompositionClock
import app.cash.molecule.RecompositionMode
import app.cash.molecule.moleculeFlow
import app.cash.turbine.test
import com.google.common.truth.Truth.assertThat
Expand Down Expand Up @@ -93,7 +93,7 @@ class ConfigureRoomPresenterTests {

@Test
fun `present - initial state`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand All @@ -108,7 +108,7 @@ class ConfigureRoomPresenterTests {

@Test
fun `present - create room button is enabled only if the required fields are completed`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand All @@ -133,7 +133,7 @@ class ConfigureRoomPresenterTests {

@Test
fun `present - state is updated when fields are changed`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand Down Expand Up @@ -203,7 +203,7 @@ class ConfigureRoomPresenterTests {

@Test
fun `present - trigger create room action`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand All @@ -221,7 +221,7 @@ class ConfigureRoomPresenterTests {

@Test
fun `present - record analytics when creating room`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand All @@ -240,7 +240,7 @@ class ConfigureRoomPresenterTests {

@Test
fun `present - trigger create room with upload error and retry`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
Expand All @@ -265,7 +265,7 @@ class ConfigureRoomPresenterTests {

@Test
fun `present - trigger retry and cancel actions`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package io.element.android.features.createroom.impl.root

import app.cash.molecule.RecompositionClock
import app.cash.molecule.RecompositionMode
import app.cash.molecule.moleculeFlow
import app.cash.turbine.test
import com.google.common.truth.Truth.assertThat
Expand Down Expand Up @@ -68,7 +68,7 @@ class CreateRoomRootPresenterTests {

@Test
fun `present - initial state`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand All @@ -82,7 +82,7 @@ class CreateRoomRootPresenterTests {

@Test
fun `present - trigger create DM action`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand All @@ -102,7 +102,7 @@ class CreateRoomRootPresenterTests {

@Test
fun `present - creating a DM records analytics event`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand All @@ -123,7 +123,7 @@ class CreateRoomRootPresenterTests {

@Test
fun `present - trigger retrieve DM action`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand All @@ -142,7 +142,7 @@ class CreateRoomRootPresenterTests {

@Test
fun `present - trigger retry create DM action`() = runTest {
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
val initialState = awaitItem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package io.element.android.features.createroom.impl.userlist

import app.cash.molecule.RecompositionClock
import app.cash.molecule.RecompositionMode
import app.cash.molecule.moleculeFlow
import app.cash.turbine.test
import com.google.common.truth.Truth.assertThat
Expand All @@ -41,7 +41,7 @@ class DefaultUserListPresenterTests {
userRepository,
UserListDataStore(),
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
Expand All @@ -62,7 +62,7 @@ class DefaultUserListPresenterTests {
userRepository,
UserListDataStore(),
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
Expand All @@ -83,7 +83,7 @@ class DefaultUserListPresenterTests {
userRepository,
UserListDataStore(),
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
Expand Down Expand Up @@ -119,7 +119,7 @@ class DefaultUserListPresenterTests {
userRepository,
UserListDataStore(),
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
Expand Down Expand Up @@ -158,7 +158,7 @@ class DefaultUserListPresenterTests {
userRepository,
UserListDataStore(),
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
Expand All @@ -183,7 +183,7 @@ class DefaultUserListPresenterTests {
userRepository,
UserListDataStore(),
)
moleculeFlow(RecompositionClock.Immediate) {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
Expand Down
Loading