Skip to content

Commit

Permalink
feat: [ANDROAPP-5802] add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmateos committed Feb 1, 2024
1 parent 0370e49 commit 005f879
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.dhis2.usescases.teidashboard.dialogs.scheduling

import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import kotlinx.coroutines.flow.MutableStateFlow
Expand All @@ -16,6 +17,7 @@ import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.mockito.Mockito.mock
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever

class SchedulingDialogUiTest {
Expand Down Expand Up @@ -125,8 +127,8 @@ class SchedulingDialogUiTest {
}

composeTestRule.onNodeWithText("Program stage").performClick()
composeTestRule.onNodeWithText("PS B").performClick()
composeTestRule.onNodeWithTag("INPUT_DROPDOWN_MENU_ITEM_1").performClick()

assert(viewModel.programStage.value == programStages[1])
verify(viewModel).updateStage(programStages[1])
}
}

0 comments on commit 005f879

Please sign in to comment.