mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Allow preview function name to end with RtlPreview
This commit is contained in:
committed by
Benoit Marty
parent
a323189373
commit
9d8c573365
+9
-4
@@ -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("))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user