diff options
| author | David Göransson <david.goransson90@gmail.com> | 2023-09-29 20:02:08 +0200 |
|---|---|---|
| committer | David Göransson <david.goransson90@gmail.com> | 2023-10-02 16:06:03 +0200 |
| commit | 3d38b605ca87c63e293afecb3e37f062c4f31265 (patch) | |
| tree | cbce556569110b160120a9ede5eea2697b0d710b /android/test/arch/src | |
| parent | 0995760e5ea6dde06b56065ea45346c1f9672839 (diff) | |
| download | mullvadvpn-3d38b605ca87c63e293afecb3e37f062c4f31265.tar.xz mullvadvpn-3d38b605ca87c63e293afecb3e37f062c4f31265.zip | |
Add Compose Preview test and fix issues
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) +} |
