diff options
| author | David Göransson <david.goransson@mullvad.net> | 2025-07-09 16:14:17 +0200 |
|---|---|---|
| committer | David Göransson <david.goransson@mullvad.net> | 2025-07-09 16:14:17 +0200 |
| commit | 4d90ff4fd81b0692945df0c67e0e8074716c14f3 (patch) | |
| tree | dc54697af312d65ff246d0fc3c07d5a44fd524af /android/app/src/androidTest | |
| parent | ab2cf79c4b36e7ecf0485e57c89b50738b4fc482 (diff) | |
| parent | b1020e692b5cb4dfefb77a75c34d4f6af569d41e (diff) | |
| download | mullvadvpn-4d90ff4fd81b0692945df0c67e0e8074716c14f3.tar.xz mullvadvpn-4d90ff4fd81b0692945df0c67e0e8074716c14f3.zip | |
Merge branch 'billing-tests-are-flaky-droid-2075'
Diffstat (limited to 'android/app/src/androidTest')
| -rw-r--r-- | android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/component/AddTimeBottomSheetTest.kt | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/component/AddTimeBottomSheetTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/component/AddTimeBottomSheetTest.kt index 095c15dafc..893ac23825 100644 --- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/component/AddTimeBottomSheetTest.kt +++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/component/AddTimeBottomSheetTest.kt @@ -78,7 +78,7 @@ class AddTimeBottomSheetTest { state = AddTimeUiState( purchaseState = null, - billingPaymentState = null, + billingPaymentState = PaymentState.NoPayment, showSitePayment = true, tunnelStateBlocked = false, ) @@ -102,7 +102,7 @@ class AddTimeBottomSheetTest { state = AddTimeUiState( purchaseState = null, - billingPaymentState = null, + billingPaymentState = PaymentState.NoPayment, tunnelStateBlocked = false, showSitePayment = true, ) @@ -271,12 +271,21 @@ class AddTimeBottomSheetTest { fun testShowPurchaseCompleteDialog() = composeExtension.use { // Arrange + val productId = ProductId(ProductIds.ThreeMonths) initBottomSheet( state = AddTimeUiState( - purchaseState = - PurchaseState.Success(ProductId(ProductIds.ThreeMonths)), - billingPaymentState = null, + purchaseState = PurchaseState.Success(productId), + billingPaymentState = + PaymentState.PaymentAvailable( + listOf( + PaymentProduct( + productId = productId, + price = ProductPrice("$30"), + status = null, + ) + ) + ), tunnelStateBlocked = false, showSitePayment = false, ) @@ -292,10 +301,20 @@ class AddTimeBottomSheetTest { fun testShowVerificationErrorDialog() = composeExtension.use { // Arrange + val productId = ProductId(ProductIds.ThreeMonths) initBottomSheet( AddTimeUiState( purchaseState = PurchaseState.VerifyingPurchase, - billingPaymentState = null, + billingPaymentState = + PaymentState.PaymentAvailable( + listOf( + PaymentProduct( + productId = productId, + price = ProductPrice("$30"), + status = null, + ) + ) + ), tunnelStateBlocked = false, showSitePayment = false, ) @@ -310,11 +329,22 @@ class AddTimeBottomSheetTest { fun testShowFetchProductsErrorDialog() = composeExtension.use { // Arrange + + val productId = ProductId(ProductIds.ThreeMonths) initBottomSheet( state = AddTimeUiState( - purchaseState = PurchaseState.Error.OtherError(ProductId("ProductId")), - billingPaymentState = null, + purchaseState = PurchaseState.Error.OtherError(productId), + billingPaymentState = + PaymentState.PaymentAvailable( + listOf( + PaymentProduct( + productId = productId, + price = ProductPrice("$30"), + status = null, + ) + ) + ), tunnelStateBlocked = false, showSitePayment = false, ) @@ -336,7 +366,7 @@ class AddTimeBottomSheetTest { state = AddTimeUiState( purchaseState = null, - billingPaymentState = null, + billingPaymentState = PaymentState.NoPayment, tunnelStateBlocked = false, showSitePayment = false, ) @@ -355,7 +385,7 @@ class AddTimeBottomSheetTest { state = AddTimeUiState( purchaseState = null, - billingPaymentState = null, + billingPaymentState = PaymentState.NoPayment, tunnelStateBlocked = true, showSitePayment = true, ) |
