From d23efc3053cbc42876ad22b3ca305f86aa63e0dd Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 20 Feb 2025 18:41:11 +0100 Subject: [PATCH] Fix Konsist test. New enterprise module was not correctly detected. Also ensure that the files are correctly found. --- .../android/tests/konsist/KonsistLicenseTest.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistLicenseTest.kt b/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistLicenseTest.kt index 24b13feb62..19fbc5b854 100644 --- a/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistLicenseTest.kt +++ b/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistLicenseTest.kt @@ -7,6 +7,7 @@ package io.element.android.tests.konsist +import com.google.common.truth.Truth.assertThat import com.lemonappdev.konsist.api.Konsist import com.lemonappdev.konsist.api.verify.assertTrue import org.junit.Test @@ -43,10 +44,13 @@ class KonsistLicenseTest { .scopeFromProject() .files .filter { - it.path.contains("/enterprise/features").not() && + it.moduleName.startsWith("enterprise").not() && it.nameWithExtension != "locales.kt" && it.name.startsWith("Template ").not() } + .also { + assertThat(it).isNotEmpty() + } .assertTrue { publicLicense.containsMatchIn(it.text) } @@ -58,7 +62,10 @@ class KonsistLicenseTest { .scopeFromProject() .files .filter { - it.path.contains("/enterprise/features") + it.moduleName.startsWith("enterprise") + } + .also { + assertThat(it).isNotEmpty() } .assertTrue { enterpriseLicense.containsMatchIn(it.text)