diff options
Diffstat (limited to 'android/test/arch/src')
| -rw-r--r-- | android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/compose/ComposePreviewTests.kt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/compose/ComposePreviewTests.kt b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/compose/ComposePreviewTests.kt new file mode 100644 index 0000000000..64b221d0c0 --- /dev/null +++ b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/compose/ComposePreviewTests.kt @@ -0,0 +1,22 @@ +package net.mullvad.mullvadvpn.test.arch.compose + +import androidx.compose.ui.tooling.preview.Preview +import com.lemonappdev.konsist.api.Konsist +import com.lemonappdev.konsist.api.ext.list.withAllAnnotationsOf +import com.lemonappdev.konsist.api.verify.assert +import org.junit.Test + +class ComposePreviewTests { + @Test + fun `all preview functions are private`() { + allPreviewFunctions().assert { it.hasPrivateModifier } + } + + @Test + fun `all preview functions are prefixed with Preview`() { + allPreviewFunctions().assert { it.name.startsWith("Preview") } + } + + private fun allPreviewFunctions() = + Konsist.scopeFromProduction().functions().withAllAnnotationsOf(Preview::class) +} |
