Skip to content

Commit

Permalink
test: all preferences fragments are TitleProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
BrayanDSO committed Nov 26, 2024
1 parent da1dee3 commit 5b0ae77
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.annotation.Config
import kotlin.reflect.jvm.jvmName

@RunWith(AndroidJUnit4::class)
class PreferencesTest : RobolectricTest() {
Expand Down Expand Up @@ -83,6 +84,20 @@ class PreferencesTest : RobolectricTest() {
}
}

@Test
fun `All preferences fragments are TitleProvider`() {
val fragments = PreferenceTestUtils.getAllPreferencesFragments(targetContext)
.filter { it !is ReviewerOptionsFragment } // WIP dev options

fragments.forEach { fragment ->
assertThat(
"${fragment::class.jvmName} should implement TitleProvider",
fragment is TitleProvider,
equalTo(true)
)
}
}

@Test
@Config(qualifiers = "ar")
fun buildHeaderSummary_RTL_Test() {
Expand Down

0 comments on commit 5b0ae77

Please sign in to comment.