Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cttsai-stripe committed Feb 26, 2025
1 parent e6b0336 commit c5683ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,9 @@ internal class PaymentSheetPage(
}
}

fun SemanticsNodeInteraction.assertHasErrorMessage(expectedMessage: String)
= assert(SemanticsMatcher("has error '$expectedMessage'") { node ->
node.config[SemanticsProperties.Error] == expectedMessage
})

fun SemanticsNodeInteraction.assertHasErrorMessage(expectedMessage: String) =
assert(
SemanticsMatcher("has error '$expectedMessage'") { node ->
node.config[SemanticsProperties.Error] == expectedMessage
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,13 @@ private fun Modifier.errorSemanticsWithDefault(
errorMessage: String?,
): Modifier = composed {
val defaultErrorMessage = stringResource(ComposeUiR.string.default_error_message)
if (isError) semantics {
error(errorMessage ?: defaultErrorMessage)
} else this
if (isError) {
semantics {
error(errorMessage ?: defaultErrorMessage)
}
} else {
this
}
}

private const val PlaceholderAnimationDuration = 83
Expand Down

0 comments on commit c5683ba

Please sign in to comment.