Skip to content

Commit

Permalink
Fix flakySafely scope
Browse files Browse the repository at this point in the history
  • Loading branch information
kirmanak committed May 7, 2024
1 parent 54887a5 commit a4cb747
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import gq.kirmanak.mealient.screen.AuthenticationScreen
import gq.kirmanak.mealient.screen.BaseUrlScreen
import gq.kirmanak.mealient.screen.DisclaimerScreen
import gq.kirmanak.mealient.screen.RecipesListScreen
import gq.kirmanak.mealient.ui.disclaimer.DisclaimerViewModel
import io.github.kakaocup.compose.node.element.ComposeScreen.Companion.onComposeScreen
import io.github.kakaocup.kakao.common.utilities.getResourceString
import org.junit.Before
Expand Down Expand Up @@ -58,16 +59,16 @@ class FirstSetUpTest : BaseTestCase() {
assertIsNotEnabled()
}

flakySafely(5_000) {
okayButton {
assertIsEnabled()
}

okayButtonText {
okayButtonText {
flakySafely(DisclaimerViewModel.FULL_COUNT_DOWN_SEC * 1_000L) {
assertTextContains(getResourceString(R.string.fragment_disclaimer_button_okay))
}
}

okayButton {
assertIsEnabled()
}

disclaimerText {
assertTextEquals(getResourceString(R.string.fragment_disclaimer_main_text))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ internal class DisclaimerViewModel @Inject constructor(
}

companion object {
private const val FULL_COUNT_DOWN_SEC = 5
const val FULL_COUNT_DOWN_SEC = 5
private const val COUNT_DOWN_TICK_PERIOD_SEC = 1
}
}

0 comments on commit a4cb747

Please sign in to comment.