-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue where continue button is disabled when canceling account se…
…lection (#7464) * Fix issue where pay button is disabled when canceling account selection
- Loading branch information
1 parent
4c5c732
commit a47ee61
Showing
16 changed files
with
190 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
paymentsheet-example/src/androidTest/java/com/stripe/android/lpm/TestUSBankAccount.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.stripe.android.lpm | ||
|
||
import androidx.compose.ui.test.assertIsEnabled | ||
import androidx.compose.ui.test.hasTestTag | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import com.stripe.android.BasePlaygroundTest | ||
import com.stripe.android.paymentsheet.example.playground.settings.Country | ||
import com.stripe.android.paymentsheet.example.playground.settings.CountrySettingsDefinition | ||
import com.stripe.android.paymentsheet.example.playground.settings.Currency | ||
import com.stripe.android.paymentsheet.example.playground.settings.CurrencySettingsDefinition | ||
import com.stripe.android.paymentsheet.example.playground.settings.DelayedPaymentMethodsSettingsDefinition | ||
import com.stripe.android.paymentsheet.ui.PAYMENT_SHEET_PRIMARY_BUTTON_TEST_TAG | ||
import com.stripe.android.test.core.AuthorizeAction | ||
import com.stripe.android.test.core.TestParameters | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
internal class TestUSBankAccount : BasePlaygroundTest() { | ||
private val testParameters = TestParameters.create( | ||
paymentMethodCode = "us_bank_account", | ||
) { settings -> | ||
settings[CountrySettingsDefinition] = Country.US | ||
settings[CurrencySettingsDefinition] = Currency.USD | ||
settings[DelayedPaymentMethodsSettingsDefinition] = true | ||
} | ||
|
||
@Test | ||
fun testUSBankAccountCancelAllowsUserToContinue() { | ||
testDriver.confirmUSBankAccount( | ||
testParameters = testParameters.copy( | ||
authorizationAction = AuthorizeAction.Cancel, | ||
), | ||
afterAuthorization = { | ||
rules.compose.onNode(hasTestTag(PAYMENT_SHEET_PRIMARY_BUTTON_TEST_TAG)) | ||
.assertIsEnabled() | ||
} | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters