File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
feature-main/src/test/java/com/hoc/flowmvi/ui/main Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import kotlinx.coroutines.flow.flow
16
16
import kotlinx.coroutines.flow.flowOf
17
17
import java.io.IOException
18
18
import kotlin.test.Test
19
+ import kotlin.time.Duration
19
20
import kotlin.time.ExperimentalTime
20
21
21
22
private val USERS = listOf (
@@ -191,4 +192,18 @@ class MainVMTest : BaseMviViewModelTest<
191
192
),
192
193
) { coVerify(exactly = 1 ) { refreshGetUsersUseCase() } }
193
194
}
195
+
196
+ @Test
197
+ fun test_withRefreshIntent_ignoredWhenIsLoading () {
198
+ test(
199
+ vmProducer = {
200
+ coEvery { refreshGetUsersUseCase() } returns Unit
201
+ vm
202
+ },
203
+ intents = flowOf(ViewIntent .Refresh ),
204
+ expectedStates = listOf (ViewState .initial()),
205
+ expectedEvents = emptyList(),
206
+ delayAfterDispatchingIntents = Duration .milliseconds(100 ),
207
+ ) { coVerify(exactly = 0 ) { refreshGetUsersUseCase() } }
208
+ }
194
209
}
You can’t perform that action at this time.
0 commit comments