diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 44b014817..db326c380 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -194,7 +194,8 @@ jobs: - name: Run local tests (including Roborazzi) for the combined coverage report (only API 30) if: matrix.api-level == 30 - run: ./gradlew testDemoDebugUnitTest # Add Prod if we ever add JVM tests for prod + # There is no need to verify Roborazzi tests to generate coverage. + run: ./gradlew testDemoDebugUnitTest -Proborazzi.test.verify=false # Add Prod if we ever add JVM tests for prod # Add `createProdDebugUnitTestCoverageReport` if we ever add JVM tests for prod - name: Generate coverage reports for Debug variants (only API 30) diff --git a/core/designsystem/src/test/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/ButtonScreenshotTests.kt b/core/designsystem/src/test/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/ButtonScreenshotTests.kt index 2f6ab5370..d514f9a67 100644 --- a/core/designsystem/src/test/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/ButtonScreenshotTests.kt +++ b/core/designsystem/src/test/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/ButtonScreenshotTests.kt @@ -23,6 +23,7 @@ import androidx.compose.material3.Text import androidx.compose.ui.test.junit4.createAndroidComposeRule import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaButton import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaOutlinedButton +import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaTextButton import com.google.samples.apps.nowinandroid.core.designsystem.icon.NiaIcons import com.google.samples.apps.nowinandroid.core.testing.util.captureMultiTheme import dagger.hilt.android.testing.HiltTestApplication @@ -77,4 +78,21 @@ class ButtonScreenshotTests { } } } + + @Test + fun niaTextButton_coverageTest() { + composeTestRule.captureMultiTheme( + name = "TextButton", + overrideFileName = "TextButton", + shouldCompareAndroidTheme = false, + ) { description -> + Surface { + NiaTextButton( + onClick = {}, + text = { Text("Coverage test") }, + leadingIcon = { Icon(imageVector = NiaIcons.Add, contentDescription = null) }, + ) + } + } + } }