Hi all :android-wave: , I am getting the following...
# compose
a
Hi all 👋 , I am getting the following error when running Compose UI tests. Could anyone please help thank you color . Error
Copy code
java.lang.IllegalStateException: State must be at least 'CREATED' to be moved to 'DESTROYED' in component NavBackStackEntry(7a23a02c-5dfa-43df-8510-97bda229a7da) destination=Destination(0x98d0beb0) route=settings
Dependencies
Copy code
navigation-compose = "2.9.0-beta03"
plus one 1
Test code
Copy code
@RunWith(AndroidJUnit4::class)
internal class NavigationTest {
    @get:Rule(order = 0)
    val koinTestRule = KoinTestRule(
        modules = listOf(
            MyAppModule().module,
        ),
    )

    @get:Rule(order = 1)
    val composeTestRule = createAndroidComposeRule<MainActivity>()

    @Test
    fun navigationTest() {
        composeTestRule
            .onNodeWithTag(
                testTag = "screen_home",
            )
            .assertIsDisplayed()
        composeTestRule.waitUntil {
            composeTestRule
                .onNodeWithContentDescription(
                    "Settings",
                )
                .isDisplayed()
        }
 
        // This click action is throwing the exception. It navigates to Settings screen on clicking.
        composeTestRule
            .onNodeWithContentDescription(
                "Settings",
            )
            .performClick()
        composeTestRule.waitForIdle()
    }
}