Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 063ee6d0 authored by Olivier St-Onge's avatar Olivier St-Onge
Browse files

Only assert on nodes with content descriptions in drag and drop test

Flag: EXEMPT bugfix
Fixes: 382381856
Test: DragAndDropTest.kt
Change-Id: I45dbea997e8b55b48d73a6969085b9e464c89942
parent ff65f869
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -22,7 +22,10 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.SemanticsProperties
import androidx.compose.ui.test.SemanticsMatcher
import androidx.compose.ui.test.assert
import androidx.compose.ui.test.filter
import androidx.compose.ui.test.hasContentDescription
import androidx.compose.ui.test.junit4.ComposeContentTestRule
import androidx.compose.ui.test.junit4.createComposeRule
@@ -182,7 +185,10 @@ class DragAndDropTest : SysuiTestCase() {
    }

    private fun ComposeContentTestRule.assertTileGridContainsExactly(specs: List<String>) {
        onNodeWithTag(CURRENT_TILES_GRID_TEST_TAG).onChildren().apply {
        onNodeWithTag(CURRENT_TILES_GRID_TEST_TAG)
            .onChildren()
            .filter(SemanticsMatcher.keyIsDefined(SemanticsProperties.ContentDescription))
            .apply {
                fetchSemanticsNodes().forEachIndexed { index, _ ->
                    get(index).assert(hasContentDescription(specs[index]))
                }