diff options
| author | Albin <albin@mullvad.net> | 2024-03-05 12:49:55 +0100 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2024-03-05 12:49:55 +0100 |
| commit | 8e993df31f96080b1cf51eef216092befec6c306 (patch) | |
| tree | d22ee6cb19b802c65cf447eaa8f767d495cbd112 /android/test | |
| parent | 436a14d46c6f7d4a74f197c02903e11644d5db92 (diff) | |
| parent | ca566755a7722c7af296ab1464b9b3692a96def9 (diff) | |
| download | mullvadvpn-8e993df31f96080b1cf51eef216092befec6c306.tar.xz mullvadvpn-8e993df31f96080b1cf51eef216092befec6c306.zip | |
Merge branch 'start-using-collectasstatewithlifecycle-droid-563'
Diffstat (limited to 'android/test')
| -rw-r--r-- | android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/compose/ComposeTest.kt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/compose/ComposeTest.kt b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/compose/ComposeTest.kt index fc84d3d0aa..15c581c23b 100644 --- a/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/compose/ComposeTest.kt +++ b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/compose/ComposeTest.kt @@ -3,6 +3,7 @@ package net.mullvad.mullvadvpn.test.arch.compose import androidx.compose.runtime.Composable import com.lemonappdev.konsist.api.Konsist import com.lemonappdev.konsist.api.ext.list.withAllAnnotationsOf +import com.lemonappdev.konsist.api.verify.assertFalse import com.lemonappdev.konsist.api.verify.assertTrue import org.junit.jupiter.api.Test @@ -13,6 +14,16 @@ class ComposeTest { it.resideInPackage("net.mullvad.mullvadvpn.compose..") } + @Test + fun `ensure we don't use collectAsState`() = + Konsist.scopeFromProduction("app").imports.assertFalse { + it.name == "androidx.compose.runtime.collectAsState" + } + + @Test + fun `ensure all composables do not refer to state as uiState`() = + allAppComposeFunctions().assertFalse { it.hasParameter { it.name == "uiState" } } + private fun allAppComposeFunctions() = Konsist.scopeFromProduction("app").functions().withAllAnnotationsOf(Composable::class) } |
