Skip to content

Commit

Permalink
[#83] Update loading test case
Browse files Browse the repository at this point in the history
  • Loading branch information
kaungkhantsoe committed Feb 20, 2023
1 parent c58e1db commit 8efff23
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import co.nimblehq.compose.crypto.ui.screens.home.FIAT_CURRENCY
import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOf
import org.junit.Before
Expand Down Expand Up @@ -57,13 +58,13 @@ class DetailScreenUiTest : BaseScreenTest() {

@Test
fun when_navigating_to_detail_screen_it_shows_loading() {
composeAndroidTestRule.activity.setContent {
DetailScreen(
coinId = "",
navigator = { destination ->
appDestination = destination
}
)
every { mockGetCoinDetailUseCase.execute(any()) } returns flow {
delay(100L)
emit(coinDetail)
}
every { mockGetCoinPricesUseCase.execute(any()) } returns flow {
delay(100L)
emit(coinPrices)
}

with(composeAndroidTestRule) {
Expand Down

0 comments on commit 8efff23

Please sign in to comment.