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

Commit 6407e3b6 authored by Chaohui Wang's avatar Chaohui Wang Committed by Gerrit Code Review
Browse files

Merge "Fix infoPage_whenNotChangeableAndClick flaky" into main

parents dbae153d b8371c57
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -160,23 +160,25 @@ class TogglePermissionAppInfoPageTest {
    @Test
    fun infoPage_whenChangeableAndClick() {
        val listModel = TestTogglePermissionAppListModel(isAllowed = false, isChangeable = true)
        val switchTitle = context.getString(listModel.switchTitleResId)

        setTogglePermissionAppInfoPage(listModel)
        composeTestRule.onNodeWithText(context.getString(listModel.switchTitleResId)).performClick()
        composeTestRule.waitUntilExists(hasText(switchTitle))
        composeTestRule.onNodeWithText(switchTitle).performClick()

        composeTestRule.waitUntilExists(
            hasText(context.getString(listModel.switchTitleResId)) and isOn())
        composeTestRule.waitUntilExists(hasText(switchTitle) and isOn())
    }

    @Test
    fun infoPage_whenNotChangeableAndClick() {
        val listModel = TestTogglePermissionAppListModel(isAllowed = false, isChangeable = false)
        val switchTitle = context.getString(listModel.switchTitleResId)

        setTogglePermissionAppInfoPage(listModel)
        composeTestRule.onNodeWithText(context.getString(listModel.switchTitleResId)).performClick()
        composeTestRule.waitUntilExists(hasText(switchTitle))
        composeTestRule.onNodeWithText(switchTitle).performClick()

        composeTestRule.waitUntilExists(
            hasText(context.getString(listModel.switchTitleResId)) and isOff())
        composeTestRule.waitUntilExists(hasText(switchTitle) and isOff())
    }

    @Test