proto error

This commit is contained in:
Rune Dyselinck 2023-05-15 15:58:59 +02:00
parent 522ecae87a
commit 74526bc984
6 changed files with 80 additions and 14 deletions

View file

@ -0,0 +1,42 @@
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.common.composable.drawer.DrawerActions
import be.ugent.sel.studeez.common.composable.feed.FeedUiState
import be.ugent.sel.studeez.common.composable.navbar.NavigationBarActions
import be.ugent.sel.studeez.data.local.models.FeedEntry
import be.ugent.sel.studeez.screens.home.HomeScreen
import org.junit.Rule
import org.junit.Test
class HomeScreenTest {
@get:Rule
val composeTestRule = createComposeRule()
@Test
fun sessionRecapTestt() {
var saveCalled = false
composeTestRule.setContent {
HomeScreen(
open = {},
drawerActions = DrawerActions({}, {}, {}, {}, {}),
navigationBarActions = NavigationBarActions({false}, {}, {}, {}, {}, {}, {}, {}),
feedUiState = FeedUiState.Succes(mapOf()),
continueTask = {_, _ -> },
onEmptyFeedHelp = {}
)
}
composeTestRule
.onNodeWithText(
"continue",
substring = true,
ignoreCase = true
)
.assertExists()
.performClick()
}
}

View file

@ -14,7 +14,7 @@ import org.junit.Assert.*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
class InstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.

View file

@ -18,7 +18,7 @@ class SessionScreenTest {
val composeTestRule = createComposeRule()
@Test
fun SessionRecapTest() {
fun sessionRecapTest() {
var saveCalled = false
var discardCalled = false
@ -67,4 +67,6 @@ class SessionScreenTest {
Assert.assertTrue(saveCalled)
Assert.assertTrue(discardCalled)
}
}