Konsist: add test to ensure that functions with @PreviewsDayNight contain ElementTheme composable, and fix existing issues.
This commit is contained in:
parent
6230d9d48b
commit
8ca42d4cfc
5 changed files with 22 additions and 9 deletions
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue