Allow preview function name to end with RtlPreview
This commit is contained in:
committed by
Benoit Marty
parent
91369e9455
commit
c0fe9f2616
@@ -166,10 +166,15 @@ class KonsistPreviewTest {
|
||||
additionalMessage = "Functions for Preview should be named like this: <ViewUnderPreview>Preview. " +
|
||||
"Exception can be added to the test, for multiple Previews of the same view",
|
||||
) {
|
||||
val testedView = it.name.removeSuffix("Preview")
|
||||
it.text.contains("$testedView(") ||
|
||||
it.text.contains("$testedView {") ||
|
||||
it.text.contains("ContentToPreview(")
|
||||
val testedView = if (it.name.endsWith("RtlPreview")) {
|
||||
it.name.removeSuffix("RtlPreview")
|
||||
} else {
|
||||
it.name.removeSuffix("Preview")
|
||||
}
|
||||
it.name.endsWith("Preview") &&
|
||||
(it.text.contains("$testedView(") ||
|
||||
it.text.contains("$testedView {") ||
|
||||
it.text.contains("ContentToPreview("))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user