Allow preview function name to end with RtlPreview
This commit is contained in:
parent
91369e9455
commit
c0fe9f2616
1 changed files with 9 additions and 4 deletions
|
|
@ -166,10 +166,15 @@ class KonsistPreviewTest {
|
||||||
additionalMessage = "Functions for Preview should be named like this: <ViewUnderPreview>Preview. " +
|
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",
|
"Exception can be added to the test, for multiple Previews of the same view",
|
||||||
) {
|
) {
|
||||||
val testedView = it.name.removeSuffix("Preview")
|
val testedView = if (it.name.endsWith("RtlPreview")) {
|
||||||
it.text.contains("$testedView(") ||
|
it.name.removeSuffix("RtlPreview")
|
||||||
it.text.contains("$testedView {") ||
|
} else {
|
||||||
it.text.contains("ContentToPreview(")
|
it.name.removeSuffix("Preview")
|
||||||
|
}
|
||||||
|
it.name.endsWith("Preview") &&
|
||||||
|
(it.text.contains("$testedView(") ||
|
||||||
|
it.text.contains("$testedView {") ||
|
||||||
|
it.text.contains("ContentToPreview("))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue