Skip to content

Commit

Permalink
Switch to editing via toggleEditing instead of clicking editing butto…
Browse files Browse the repository at this point in the history
…n in PaymentSheetActivityTest test (#8728)

* Increase timeout in a PaymentSheetActivityTest test

* Switch to editing via toggleEditing instead of clicking editing button in PaymentSheetActivityTest test
  • Loading branch information
amk-stripe committed Jul 2, 2024
1 parent 9342b06 commit dac12e1
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertIsEnabled
import androidx.compose.ui.test.assertIsNotEnabled
import androidx.compose.ui.test.assertIsSelected
import androidx.compose.ui.test.hasTestTag
import androidx.compose.ui.test.hasText
import androidx.compose.ui.test.isSelected
import androidx.compose.ui.test.junit4.createAndroidComposeRule
Expand Down Expand Up @@ -58,7 +57,6 @@ import com.stripe.android.paymentsheet.navigation.PaymentSheetScreen.SelectSaved
import com.stripe.android.paymentsheet.state.LinkState
import com.stripe.android.paymentsheet.state.WalletsProcessingState
import com.stripe.android.paymentsheet.ui.GOOGLE_PAY_BUTTON_TEST_TAG
import com.stripe.android.paymentsheet.ui.PAYMENT_SHEET_EDIT_BUTTON_TEST_TAG
import com.stripe.android.paymentsheet.ui.PAYMENT_SHEET_PRIMARY_BUTTON_TEST_TAG
import com.stripe.android.paymentsheet.ui.PrimaryButton
import com.stripe.android.paymentsheet.ui.SHEET_NAVIGATION_BUTTON_TAG
Expand Down Expand Up @@ -437,14 +435,7 @@ internal class PaymentSheetActivityTest {
val scenario = activityScenario(viewModel)

scenario.launch(intent).onActivity { activity ->
composeTestRule.onNodeWithTag(
PAYMENT_SHEET_EDIT_BUTTON_TEST_TAG,
).performClick()

composeTestRule.waitUntil(timeoutMillis = 5_000) {
composeTestRule.onAllNodes(hasTestTag(TEST_TAG_REMOVE_BADGE), useUnmergedTree = true)
.fetchSemanticsNodes().isNotEmpty()
}
viewModel.toggleEditing()

composeTestRule.onNodeWithTag(
TEST_TAG_REMOVE_BADGE,
Expand Down

0 comments on commit dac12e1

Please sign in to comment.