Skip to content

Commit

Permalink
#9 - Create a simple UI test
Browse files Browse the repository at this point in the history
  • Loading branch information
jhg3410 committed Feb 24, 2023
1 parent 3a0ef3a commit b46cdee
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.example.compose.rally

import androidx.compose.ui.test.assertIsSelected
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithContentDescription
import com.example.compose.rally.ui.components.RallyTopAppBar
import org.junit.Rule
import org.junit.Test

class TopAppBarTest {

@get:Rule
val composeTestRule = createComposeRule()

@Test
fun rallyTopAppBarTest() {
val allScreens = RallyScreen.values().toList()
composeTestRule.setContent {
RallyTopAppBar(
allScreens = allScreens,
onTabSelected = {},
currentScreen = RallyScreen.Accounts
)
}

composeTestRule
.onNodeWithContentDescription(RallyScreen.Accounts.name)
.assertIsSelected()
}
}

0 comments on commit b46cdee

Please sign in to comment.