feature (room upgrade) : add tests

This commit is contained in:
ganfra 2025-06-11 16:16:41 +02:00
parent e8bc54cf9e
commit 09e5734251
7 changed files with 173 additions and 1 deletions

View file

@ -16,6 +16,7 @@ import androidx.compose.ui.test.hasTestTag
import androidx.compose.ui.test.hasText
import androidx.compose.ui.test.junit4.AndroidComposeTestRule
import androidx.compose.ui.test.onFirst
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import io.element.android.libraries.ui.strings.CommonStrings
import org.junit.rules.TestRule
@ -54,3 +55,8 @@ fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.pressBackKey() {
fun SemanticsNodeInteractionsProvider.pressTag(tag: String) {
onNode(hasTestTag(tag)).performClick()
}
fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.assertNoNodeWithText(@StringRes res: Int) {
val text = activity.getString(res)
onNodeWithText(text).assertDoesNotExist()
}