Skip to content

Commit

Permalink
Fix selectProgramStage test
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddharth Agarwal committed Jun 14, 2024
1 parent 017de9b commit 2f288ff
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package org.dhis2.usescases.teidashboard.dialogs.scheduling

import androidx.compose.ui.test.ExperimentalTestApi
import androidx.compose.ui.test.hasTestTag
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.test.onAllNodesWithTag
import androidx.compose.ui.test.onFirst
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
Expand Down Expand Up @@ -110,6 +114,7 @@ class SchedulingDialogUiTest {
composeTestRule.onNodeWithText("Done").assertExists()
}

@OptIn(ExperimentalTestApi::class)
@Test
fun selectProgramStage() {
val programStages = listOf(
Expand All @@ -126,7 +131,8 @@ class SchedulingDialogUiTest {
}
}

composeTestRule.onNodeWithText("Program stage").performClick()
composeTestRule.onAllNodesWithTag("INPUT_DROPDOWN").onFirst().performClick()
composeTestRule.waitUntilExactlyOneExists(hasTestTag("INPUT_DROPDOWN_MENU_ITEM_1"))
composeTestRule.onNodeWithTag("INPUT_DROPDOWN_MENU_ITEM_1").performClick()

verify(viewModel).updateStage(programStages[1])
Expand Down

0 comments on commit 2f288ff

Please sign in to comment.