Skip to content

Instantly share code, notes, and snippets.

@rubenquadros
Created August 19, 2021 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubenquadros/9a300573f8465ef85d98b93f96c35f5a to your computer and use it in GitHub Desktop.
Save rubenquadros/9a300573f8465ef85d98b93f96c35f5a to your computer and use it in GitHub Desktop.
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