7
7
8
8
package io.element.android.libraries.troubleshoot.impl
9
9
10
- import app.cash.molecule.RecompositionMode
11
- import app.cash.molecule.moleculeFlow
12
- import app.cash.turbine.test
13
10
import com.google.common.truth.Truth.assertThat
14
11
import io.element.android.libraries.architecture.AsyncAction
15
12
import io.element.android.libraries.push.test.FakeGetCurrentPushProvider
@@ -26,9 +23,7 @@ class TroubleshootNotificationsPresenterTest {
26
23
@Test
27
24
fun `present - initial state` () = runTest {
28
25
val presenter = createTroubleshootNotificationsPresenter()
29
- moleculeFlow(RecompositionMode .Immediate ) {
30
- presenter.present()
31
- }.test {
26
+ presenter.test {
32
27
val initialState = awaitItem()
33
28
assertThat(initialState.testSuiteState.tests).isEmpty()
34
29
assertThat(initialState.testSuiteState.mainState).isEqualTo(AsyncAction .Uninitialized )
@@ -43,9 +38,7 @@ class TroubleshootNotificationsPresenterTest {
43
38
val presenter = createTroubleshootNotificationsPresenter(
44
39
troubleshootTestSuite = troubleshootTestSuite,
45
40
)
46
- moleculeFlow(RecompositionMode .Immediate ) {
47
- presenter.present()
48
- }.test {
41
+ presenter.test {
49
42
val initialState = awaitItem()
50
43
initialState.eventSink(TroubleshootNotificationsEvents .StartTests )
51
44
skipItems(1 )
@@ -66,9 +59,7 @@ class TroubleshootNotificationsPresenterTest {
66
59
val presenter = createTroubleshootNotificationsPresenter(
67
60
troubleshootTestSuite = troubleshootTestSuite,
68
61
)
69
- moleculeFlow(RecompositionMode .Immediate ) {
70
- presenter.present()
71
- }.test {
62
+ presenter.test {
72
63
val initialState = awaitItem()
73
64
initialState.eventSink(TroubleshootNotificationsEvents .RetryFailedTests )
74
65
skipItems(1 )
@@ -163,9 +154,7 @@ class TroubleshootNotificationsPresenterTest {
163
154
val presenter = createTroubleshootNotificationsPresenter(
164
155
troubleshootTestSuite = troubleshootTestSuite,
165
156
)
166
- moleculeFlow(RecompositionMode .Immediate ) {
167
- presenter.present()
168
- }.test {
157
+ presenter.test {
169
158
skipItems(1 )
170
159
val initialState = awaitItem()
171
160
assertThat(initialState.testSuiteState.mainState).isInstanceOf(AsyncAction .Failure ::class .java)
0 commit comments