Skip to content

Commit

Permalink
Fix tests screenshot names
Browse files Browse the repository at this point in the history
  • Loading branch information
DevPabloGarcia committed May 31, 2024
1 parent 5b57731 commit 765df10
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,20 @@ internal class ButtonKtTest(
darkTheme: Boolean,
loadingText: String,
) {
val extra: MutableList<String> = mutableListOf()
icon.takeIf { it }?.let { extra.add("icon") }
loadingText.takeIf { it.isNotEmpty() }?.let { extra.add("loadingText") }
val extra: String? = mutableListOf<String>().apply {
icon.takeIf { it }?.let { add("icon") }
loadingText.takeIf { it.isNotEmpty() }?.let { add("loadingText") }
}.takeIf {
it.isNotEmpty()
}?.joinToString(separator = "_")

compareScreenshot(
node = composeTestRule.onRoot(),
component = "Button",
style = style.toString(),
brand = brand,
darkTheme = darkTheme,
extra = extra.joinToString(separator = "_")
extra = extra
)
}

Expand Down

0 comments on commit 765df10

Please sign in to comment.