Konsist: add test to ensure that functions with @PreviewsDayNight contain ElementTheme composable, and fix existing issues.

This commit is contained in:
Benoit Marty 2023-10-23 11:57:04 +02:00 committed by Benoit Marty
parent 6230d9d48b
commit 8ca42d4cfc
5 changed files with 22 additions and 9 deletions

View file

@ -35,4 +35,15 @@ class KonsistPreviewTest {
it.hasNameEndingWith("DarkPreview").not()
}
}
@Test
fun `Functions with '@PreviewsDayNight' annotation should contain 'ElementPreview' composable`() {
Konsist
.scopeFromProject()
.functions()
.withAllAnnotationsOf(PreviewsDayNight::class)
.assertTrue {
it.text.contains("ElementPreview")
}
}
}