Skip to content

Commit

Permalink
style: format ktfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
francelu committed Oct 13, 2024
1 parent e7a6982 commit ef404e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class TopAppBarTest {
@Test
fun topAppBar_backButtonTrue_onBackButtonClickNotNull_doesNotThrowException() {
composeTestRule.setContent {
TopAppBar(title = "Test Title", backButton = true, onBackButtonClick = { /* Do nothing */ })
TopAppBar(title = "Test Title", backButton = true, onBackButtonClick = { /* Do nothing */})
}
composeTestRule.onNodeWithTag("topBar").assertIsDisplayed()
composeTestRule.onNodeWithTag("goBackButton").assertIsDisplayed()
Expand All @@ -84,7 +84,7 @@ class TopAppBarTest {
@Test
fun topAppBar_backButtonFalse_onBackButtonClickNotNull_doesNotThrowException() {
composeTestRule.setContent {
TopAppBar(title = "Test Title", backButton = false, onBackButtonClick = { /* Do nothing */ })
TopAppBar(title = "Test Title", backButton = false, onBackButtonClick = { /* Do nothing */})
}
composeTestRule.onNodeWithTag("topBar").assertIsDisplayed()
composeTestRule.onNodeWithTag("goBackButton").assertIsNotDisplayed()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ import com.android.periodpals.ui.theme.PurpleGrey80
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun TopAppBar(title: String, backButton: Boolean = false, onBackButtonClick: (() -> Unit)? = {}) {
require(!backButton || onBackButtonClick != null) {
"onBackButtonClick must be provided when backButton is true"
}
require(!backButton || onBackButtonClick != null) {
"onBackButtonClick must be provided when backButton is true"
}
CenterAlignedTopAppBar(
modifier = Modifier.fillMaxWidth().height(48.dp).testTag("topBar"),
title = {
Expand Down

0 comments on commit ef404e5

Please sign in to comment.