File tree 1 file changed +11
-0
lines changed
android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/compose
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package net.mullvad.mullvadvpn.test.arch.compose
3
3
import androidx.compose.runtime.Composable
4
4
import com.lemonappdev.konsist.api.Konsist
5
5
import com.lemonappdev.konsist.api.ext.list.withAllAnnotationsOf
6
+ import com.lemonappdev.konsist.api.verify.assertFalse
6
7
import com.lemonappdev.konsist.api.verify.assertTrue
7
8
import org.junit.jupiter.api.Test
8
9
@@ -13,6 +14,16 @@ class ComposeTest {
13
14
it.resideInPackage(" net.mullvad.mullvadvpn.compose.." )
14
15
}
15
16
17
+ @Test
18
+ fun `ensure we don't use collectAsState` () =
19
+ Konsist .scopeFromProduction(" app" ).imports.assertFalse {
20
+ it.name == " androidx.compose.runtime.collectAsState"
21
+ }
22
+
23
+ @Test
24
+ fun `ensure all composables do not refer to state as uiState` () =
25
+ allAppComposeFunctions().assertFalse { it.hasParameter { it.name == " uiState" } }
26
+
16
27
private fun allAppComposeFunctions () =
17
28
Konsist .scopeFromProduction(" app" ).functions().withAllAnnotationsOf(Composable ::class )
18
29
}
You can’t perform that action at this time.
0 commit comments