mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +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
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
|
||||
@Immutable
|
||||
sealed interface GlobalSearchEvent {
|
||||
object ClearQuery : GlobalSearchEvent
|
||||
object ToggleSearchVisibility : GlobalSearchEvent
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
+5
-2
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user