Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
App bar test
class AppBarTest {
@get:Rule val composeTestRule = createComposeRule()
@Test
fun given_title_should_be_displayed_in_home_app_bar() {
// Load our composable
composeTestRule.setContent {
EpicWorldTheme {
HomeAppBar(
title = "Title",
searchClick = {},
filterClick = {}
)
}
}
// onNode - Finder
// assertIsDisplayed - Assertion
composeTestRule
.onNodeWithText("Title")
.assertIsDisplayed()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment