Update Konsist test and fix existing issue.

This commit is contained in:
Benoit Marty
2026-08-25 11:21:10 +02:00
parent d7310b6941
commit 0a9a25d940
3 changed files with 8 additions and 8 deletions
@@ -7,9 +7,6 @@
package io.element.android.features.home.impl.search
import androidx.compose.runtime.Immutable
@Immutable
sealed interface GlobalSearchEvent {
object ClearQuery : GlobalSearchEvent
object ToggleSearchVisibility : GlobalSearchEvent
@@ -49,12 +49,12 @@ class KonsistArchitectureTest {
}
@Test
fun `Events MUST be sealed interface`() {
fun `Event MUST be sealed interface`() {
Konsist.scopeFromProject()
.classes()
.withSealedModifier()
.withNameEndingWith("Events")
.assertEmpty(additionalMessage = "Events class MUST be sealed interface")
.withNameEndingWith("Event")
.assertEmpty(additionalMessage = "Event class MUST be sealed interface")
}
@Test
@@ -67,11 +67,14 @@ class KonsistImmutableTest {
}
@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
.scopeFromProduction()
.interfaces()
.withNameEndingWith("Events")
.withoutName(
"LatestEvent",
)
.withNameEndingWith("Event")
.withAnnotationOf(Immutable::class)
.assertEmpty()
}