mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Update Konsist test and fix existing issue.
This commit is contained in:
-3
@@ -7,9 +7,6 @@
|
|||||||
|
|
||||||
package io.element.android.features.home.impl.search
|
package io.element.android.features.home.impl.search
|
||||||
|
|
||||||
import androidx.compose.runtime.Immutable
|
|
||||||
|
|
||||||
@Immutable
|
|
||||||
sealed interface GlobalSearchEvent {
|
sealed interface GlobalSearchEvent {
|
||||||
object ClearQuery : GlobalSearchEvent
|
object ClearQuery : GlobalSearchEvent
|
||||||
object ToggleSearchVisibility : GlobalSearchEvent
|
object ToggleSearchVisibility : GlobalSearchEvent
|
||||||
|
|||||||
+3
-3
@@ -49,12 +49,12 @@ class KonsistArchitectureTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `Events MUST be sealed interface`() {
|
fun `Event MUST be sealed interface`() {
|
||||||
Konsist.scopeFromProject()
|
Konsist.scopeFromProject()
|
||||||
.classes()
|
.classes()
|
||||||
.withSealedModifier()
|
.withSealedModifier()
|
||||||
.withNameEndingWith("Events")
|
.withNameEndingWith("Event")
|
||||||
.assertEmpty(additionalMessage = "Events class MUST be sealed interface")
|
.assertEmpty(additionalMessage = "Event class MUST be sealed interface")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+5
-2
@@ -67,11 +67,14 @@ class KonsistImmutableTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `Immutable annotation is not used on sealed interface for Presenter Events`() {
|
fun `Immutable annotation is not used on sealed interface for Presenter Event`() {
|
||||||
Konsist
|
Konsist
|
||||||
.scopeFromProduction()
|
.scopeFromProduction()
|
||||||
.interfaces()
|
.interfaces()
|
||||||
.withNameEndingWith("Events")
|
.withoutName(
|
||||||
|
"LatestEvent",
|
||||||
|
)
|
||||||
|
.withNameEndingWith("Event")
|
||||||
.withAnnotationOf(Immutable::class)
|
.withAnnotationOf(Immutable::class)
|
||||||
.assertEmpty()
|
.assertEmpty()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user