Add Konsist check to ensure that '@PreviewLightDark' is not used.
This commit is contained in:
parent
c98cb56b74
commit
4fe7b601af
1 changed files with 13 additions and 0 deletions
|
|
@ -16,8 +16,10 @@
|
|||
|
||||
package io.element.android.tests.konsist
|
||||
|
||||
import androidx.compose.ui.tooling.preview.PreviewLightDark
|
||||
import com.lemonappdev.konsist.api.Konsist
|
||||
import com.lemonappdev.konsist.api.ext.list.withAllAnnotationsOf
|
||||
import com.lemonappdev.konsist.api.verify.assertEmpty
|
||||
import com.lemonappdev.konsist.api.verify.assertTrue
|
||||
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||
import org.junit.Test
|
||||
|
|
@ -57,4 +59,15 @@ class KonsistPreviewTest {
|
|||
it.hasInternalModifier
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Ensure that '@PreviewLightDark' is not used`() {
|
||||
Konsist
|
||||
.scopeFromProject()
|
||||
.functions()
|
||||
.withAllAnnotationsOf(PreviewLightDark::class)
|
||||
.assertEmpty(
|
||||
additionalMessage = "Use '@PreviewsDayNight' instead of '@PreviewLightDark', or else screenshot(s) will not be generated.",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue