This repository has been archived on 2023-08-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2023SELab1-project-Studeez/app/src/androidTest/java/be/ugent/sel/studeez/TimerSelectionScreenTest.kt
Rune Dyselinck 860fb5fac1 ui tests
2023-05-15 21:53:04 +02:00

40 lines
No EOL
1.1 KiB
Kotlin

package be.ugent.sel.studeez
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import be.ugent.sel.studeez.screens.timer_selection.TimerSelectionActions
import be.ugent.sel.studeez.screens.timer_selection.TimerSelectionScreen
import kotlinx.coroutines.flow.flowOf
import org.junit.Rule
import org.junit.Test
class TimerSelectionScreenTest {
@get:Rule
val composeTestRule = createComposeRule()
@Test
fun timerOverviewScreenTest() {
var start = false
composeTestRule.setContent {
TimerSelectionScreen(
timerSelectionActions = TimerSelectionActions({ flowOf()}, {start = true}, 0),
popUp = {}
)
}
composeTestRule.waitForIdle()
composeTestRule
.onNodeWithText(
text = "start",
substring = true,
ignoreCase = true
)
.assertExists()
.performClick()
assert(start)
}
}