Skip to content

Commit

Permalink
Name of the parameterized test
Browse files Browse the repository at this point in the history
  • Loading branch information
pmartinbTEF committed Nov 8, 2023
1 parent a7713f2 commit d4dbef6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ internal class ButtonKtTest(private val brand: Brand, private val style: ButtonS

companion object {
@JvmStatic
@ParameterizedRobolectricTestRunner.Parameters(name = "Input: {0}")
@ParameterizedRobolectricTestRunner.Parameters(name = "Button {1} {0} icon={2} darkTheme={3}")
fun brands(): List<Array<Any>> {
val brands2 = listOf(
MovistarBrand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.rules.activityScenarioRule
import com.telefonica.mistica.DummyActivity
import com.telefonica.mistica.R
import com.telefonica.mistica.compose.theme.brand.MovistarBrand
import com.telefonica.mistica.testutils.ScreenshotsTest
import org.junit.Rule
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@ object ScreenshotUtils {
"${component}_${style}"
}
val brandValue = if (brand != null) {
"${brand::class.java.simpleName}"
brand::class.java.simpleName
} else {
null
}
val asasda = listOfNotNull(
val nonNullParams = listOfNotNull(
componentOrTestName,
brandValue,
extra,
"dark".takeIf { darkTheme }
).joinToString(separator = "_")
return """screenshots/
$asasda"""
.plus(".png").replace("\\s+".toRegex(), "")

return """screenshots/$nonNullParams""".plus(".png").replace("\\s+".toRegex(), "")
}

}

0 comments on commit d4dbef6

Please sign in to comment.